mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Alerts on duplex status change on SNMP interface (#2349)
This commit is contained in:
parent
978996af38
commit
7590f629fe
6 changed files with 35 additions and 0 deletions
|
|
@ -3500,6 +3500,25 @@ function notify_snmp_device_interface_status_change(snmp_host, snmp_interface)
|
|||
ntop.rpushCache(alert_process_queue, json.encode(obj))
|
||||
end
|
||||
|
||||
function notify_snmp_device_interface_duplexstatus_change(snmp_host, snmp_interface)
|
||||
local msg = i18n("alerts_dashboard.snmp_port_changed_duplex_status",
|
||||
{device = snmp_host,
|
||||
port = snmp_interface["name"] or snmp_interface["index"],
|
||||
url = ntop.getHttpPrefix()..string.format("/lua/pro/enterprise/snmp_device_details.lua?host=%s", snmp_host),
|
||||
port_url = ntop.getHttpPrefix()..string.format("/lua/pro/enterprise/snmp_interface_details.lua?host=%s&snmp_port_idx=%d", snmp_host, snmp_interface["index"]),
|
||||
new_op = snmp_duplexstatus(snmp_interface["duplexstatus"])})
|
||||
|
||||
local entity_value = string.format("%s_ifidx%d", snmp_host, snmp_interface["index"])
|
||||
local obj = {entity_type = alertEntity("snmp_device"),
|
||||
entity_value = entity_value,
|
||||
type = alertType("port_duplexstatus_change"),
|
||||
severity = alertSeverity("info"),
|
||||
message = msg, when = os.time()
|
||||
}
|
||||
|
||||
ntop.rpushCache(alert_process_queue, json.encode(obj))
|
||||
end
|
||||
|
||||
function notify_snmp_device_interface_errors(snmp_host, snmp_interface)
|
||||
local msg = i18n("alerts_dashboard.snmp_port_errors_increased",
|
||||
{device = snmp_host,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue