Various fixes on the SNMP engaged alerts page. (#8187)

This commit is contained in:
Nicolo Maio 2024-01-26 16:19:38 +01:00
parent 10381eea98
commit 55bbf18aaf
9 changed files with 72 additions and 20 deletions

View file

@ -326,17 +326,19 @@ function alerts_api.trigger(entity_info, type_info, when, cur_alerts)
type_info.score = 0
end
local device_ip, port
local device_ip, port, device_name
if (entity_info.alert_entity.entity_id == alert_consts.alertEntity("snmp_device")) then
local snmp_device_alert_store = require "snmp_device_alert_store".new()
device_ip, port = snmp_device_alert_store:_entity_val_to_ip_and_port(entity_info.entity_val)
device_name = snmp_device_alert_store:get_snmp_device_sysname(device_ip)
end
local params = {
alert_key_name, granularity_id,
type_info.score, type_info.alert_type.alert_key,
subtype, alert_json, device_ip
subtype, alert_json, device_ip,
device_name, port
}
if(entity_info.alert_entity.entity_id == alert_consts.alertEntity("interface")) then