Fix SNMP alerts in case of bad port number provided by the check

This commit is contained in:
Alfredo Cardigliano 2023-06-06 10:35:43 +00:00 committed by Nicolo Maio
parent 69e7bcd2e4
commit 488f80f476
9 changed files with 134 additions and 17 deletions

View file

@ -191,7 +191,7 @@ function alerts_api.store(entity_info, type_info, when)
if(not areAlertsEnabled()) then
return(false)
end
--tprint("IN ALERTS_API STORE")
local force = false
local ifid = interface.getId()
local granularity_sec = type_info.granularity and type_info.granularity.granularity_seconds or 0
@ -199,6 +199,7 @@ function alerts_api.store(entity_info, type_info, when)
type_info.alert_type_params = type_info.alert_type_params or {}
addAlertGenerationInfo(type_info.alert_type_params)
--tprint(type_info)
local alert_json = json.encode(type_info.alert_type_params)
local subtype = type_info.subtype or ""