Score computation fix (external alerts)

This commit is contained in:
Alfredo Cardigliano 2020-02-24 12:27:48 +01:00
parent b4aae5d97a
commit dbe07bbfcd
3 changed files with 18 additions and 16 deletions

View file

@ -22,11 +22,12 @@ local script = {
-- #################################################################
function script.hooks.periodicUpdate(now)
local ext_alert_info = flow.retrieveExternalAlertInfo()
local info_json = flow.retrieveExternalAlertInfo()
if(info_json ~= nil) then
if(ext_alert_info ~= nil) then
-- NOTE: the same info will *not* be returned in the next periodicUpdate
local info = json.decode(ext_alert_info)
local info = json.decode(info_json)
if info ~= nil then
flow.triggerStatus(flow_consts.status_types.status_external_alert,
info, nil, nil, nil, info.severity_id)