mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Fixes alert_generation nil value
This commit is contained in:
parent
747f4675d8
commit
0858d1bb79
1 changed files with 6 additions and 3 deletions
|
|
@ -135,10 +135,13 @@ end
|
|||
--! @param alert_json Host info will be placed in key `host_info` of table `alert_json`
|
||||
local function addAlertHostInfo(triggered)
|
||||
if triggered then
|
||||
-- Add only minimal information to keep the final result as small as possible
|
||||
alert = json.decode(triggered.alert_json)
|
||||
alert.alert_generation.host_info = host.getMinInfo()
|
||||
triggered.alert_json = json.encode(alert)
|
||||
-- Add only minimal information to keep the final result as small as possible
|
||||
-- only if the alert_generation is not nil
|
||||
if alert.alert_generation then
|
||||
alert.alert_generation.host_info = host.getMinInfo()
|
||||
triggered.alert_json = json.encode(alert)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue