Handles per-interface alerts via the AlertsManager

This commit moves the global ntopng-wide alerts to
interfaces' AlertsManager s
This commit is contained in:
Simone Mainardi 2016-08-09 16:47:36 +02:00
parent 6e91918ea8
commit 52abb7659a
17 changed files with 262 additions and 203 deletions

View file

@ -279,7 +279,7 @@ function check_host_alert(ifname, hostname, mode, key, old_json, new_json)
-- re-arm the alert
re_arm_alert(key, mode, t[1], ifname)
-- and send it to ntopng
ntop.queueAlert(alert_level, alert_status, alert_type, alert_msg)
interface.queueAlert(alert_level, alert_status, alert_type, alert_msg)
if ntop.isPro() then
-- possibly send the alert to nagios as well
ntop.sendNagiosAlert(string.gsub(key, "@0", "") --[[ vlan 0 is implicit for hosts --]],
@ -365,7 +365,7 @@ function check_network_alert(ifname, network_name, mode, key, old_table, new_tab
if not is_alert_re_arming(network_name, mode, t[1], ifname) then
if verbose then io.write("queuing alert\n") end
re_arm_alert(network_name, mode, t[1], ifname)
ntop.queueAlert(alert_level, alert_status, alert_type, alert_msg)
interface.queueAlert(alert_level, alert_status, alert_type, alert_msg)
if ntop.isPro() then
-- possibly send the alert to nagios as well
ntop.sendNagiosAlert(network_name, mode, t[1], alert_msg)
@ -433,7 +433,7 @@ function check_interface_alert(ifname, mode, old_table, new_table)
if not is_alert_re_arming(ifname_clean, mode, t[1], ifname) then
if verbose then io.write("queuing alert\n") end
re_arm_alert(ifname_clean, mode, t[1], ifname)
ntop.queueAlert(alert_level, alert_status, alert_type, alert_msg)
interface.queueAlert(alert_level, alert_status, alert_type, alert_msg)
if ntop.isPro() then
-- possibly send the alert to nagios as well
ntop.sendNagiosAlert(ifname_clean, mode, t[1], alert_msg)