mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-01 00:19:33 +00:00
Fix alert_endpoints/{syslog.lua,slack.lua} error 'attempt to index a nil value'
This commit is contained in:
parent
14c0338b64
commit
40bf86a81d
2 changed files with 11 additions and 9 deletions
|
|
@ -64,10 +64,11 @@ function slack.dequeueAlerts(queue)
|
|||
|
||||
for _, json_message in ipairs(notifications) do
|
||||
local notif = json.decode(json_message)
|
||||
|
||||
alerts_by_types[notif.alert_entity] = alerts_by_types[notif.alert_entity] or {}
|
||||
alerts_by_types[notif.alert_entity][notif.alert_severity] = alerts_by_types[notif.alert_entity][notif.alert_severity] or {}
|
||||
table.insert(alerts_by_types[notif.alert_entity][notif.alert_severity], notif)
|
||||
if notif.alert_entity then
|
||||
alerts_by_types[notif.alert_entity] = alerts_by_types[notif.alert_entity] or {}
|
||||
alerts_by_types[notif.alert_entity][notif.alert_severity] = alerts_by_types[notif.alert_entity][notif.alert_severity] or {}
|
||||
table.insert(alerts_by_types[notif.alert_entity][notif.alert_severity], notif)
|
||||
end
|
||||
end
|
||||
|
||||
for entity_type, by_severity in pairs(alerts_by_types) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue