Example #1
0
def history_system(request, alert_id):
    alert = alerts_model.get_by_id(alert_id)
    server = server_model.get_by_id(alert['server'])

    page = request.GET.get('page', 1)
    page = int(page)

    skip = 0
    if page > 1:
        skip = 100 * (page - 1)

    total = alerts_history_model.count_notifications(alert_id=alert['_id'])
    
    on_page = 100
    if total > on_page:
        total_pages = total//on_page
    else:
        total_pages = 1

    total_pages = range(total_pages)

    notifications = alerts_history_model.get_notifications_list(alert_id=alert['_id'], limit=100, skip=skip)

    return render(request, 'alerts/history.html', {
        'notifications': notifications,
        'alert': alert,
        'server': server,
        "total_pages": total_pages,
        "page": page
    })
Example #2
0
File: alerts.py Project: gisce/AMON
def history_system(request, alert_id):
    alert = alerts_model.get_by_id(alert_id)
    server = server_model.get_by_id(alert['server'])

    page = request.GET.get('page', 1)
    page = int(page)

    skip = 0
    if page > 1:
        skip = 100 * (page - 1)

    total = alerts_history_model.count_notifications(alert_id=alert['_id'])
    
    on_page = 100
    if total > on_page:
        total_pages = total/on_page
    else:
        total_pages = 1

    total_pages = range(total_pages)

    notifications = alerts_history_model.get_notifications_list(alert_id=alert['_id'], limit=100, skip=skip)

    return render(request, 'alerts/history.html', {
        'notifications': notifications,
        'alert': alert,
        'server': server,
        "total_pages": total_pages,
        "page": page
    })
Example #3
0
File: alerts.py Project: gisce/AMON
def ajax_alert_triggers(request, alert_id=None):
    alert = alerts_model.get_by_id(alert_id)

    notifications = alerts_history_model.get_notifications_list(alert_id=alert['_id'], limit=5)

    return render(request, 'alerts/ajax_history.html', {
        "notifications": notifications,
        "rule": alert
    })
Example #4
0
def ajax_alert_triggers(request, alert_id=None):
    alert = alerts_model.get_by_id(alert_id)

    notifications = alerts_history_model.get_notifications_list(alert_id=alert['_id'], limit=5)

    return render(request, 'alerts/ajax_history.html', {
        "notifications": notifications,
        "rule": alert
    })
Example #5
0
File: alerts.py Project: gisce/AMON
def history_health_check(request, alert_id):
    data = {}
    alert = alerts_model.get_by_id(alert_id)

    notifications = alerts_history_model.get_notifications_list(alert_id=alert['_id'], limit=100)
    
    return render(request, 'alerts/history.html', {
        'notifications': notifications,
        'alert': alert,
        'data': data
    })
Example #6
0
def history_health_check(request, alert_id):
    data = {}
    alert = alerts_model.get_by_id(alert_id)

    notifications = alerts_history_model.get_notifications_list(alert_id=alert['_id'], limit=100)
    
    return render(request, 'alerts/history.html', {
        'notifications': notifications,
        'alert': alert,
        'data': data
    })
Example #7
0
def ajax_alert_triggers(request, alert_id=None):
    alert = alerts_model.get_by_id(alert_id)

    notifications = alerts_history_model.get_notifications_list(
        alert_id=alert['_id'], limit=5)

    return render_to_response('alerts/ajax_history.html', {
        "notifications": notifications,
        "rule": alert
    },
                              context_instance=RequestContext(request))
Example #8
0
def history_health_check(request, alert_id):
    data = {}
    alert = alerts_model.get_by_id(alert_id)

    notifications = alerts_history_model.get_notifications_list(
        alert_id=alert['_id'], limit=100)

    return render_to_response('alerts/history.html', {
        'notifications': notifications,
        'alert': alert,
        'data': data
    },
                              context_instance=RequestContext(request))