mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 07:59:35 +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
|
|
@ -26,11 +26,12 @@ function syslog.dequeueAlerts(queue)
|
|||
local alerts_by_types = {}
|
||||
|
||||
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)
|
||||
local notif = json.decode(json_message)
|
||||
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 _, by_severity in pairs(alerts_by_types) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue