mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Replace JSON string with TLV for alerts generated by the datapath. This removes a JSON decode in housekeeping.lua (#3148)
This commit is contained in:
parent
8caed2a438
commit
2a3bef9d6c
7 changed files with 191 additions and 75 deletions
|
|
@ -2548,24 +2548,18 @@ function checkStoreAlertsFromC(deadline)
|
|||
end
|
||||
|
||||
while(os.time() <= deadline) do
|
||||
local message = ntop.popInternalAlerts()
|
||||
local alert = ntop.popInternalAlerts()
|
||||
|
||||
if((message == nil) or (message == "")) then
|
||||
if alert == nil then
|
||||
break
|
||||
end
|
||||
|
||||
if(verbose) then print(message.."\n") end
|
||||
if(verbose) then tprint(alert) end
|
||||
|
||||
local alert = json.decode(message)
|
||||
local entity_info, type_info = processStoreAlertFromQueue(alert)
|
||||
|
||||
if(alert == nil) then
|
||||
if(verbose) then io.write("JSON Decoding error: "..message.."\n") end
|
||||
else
|
||||
local entity_info, type_info = processStoreAlertFromQueue(alert)
|
||||
|
||||
if((type_info ~= nil) and (entity_info ~= nil)) then
|
||||
alerts_api.store(entity_info, type_info, alert.alert_tstamp)
|
||||
end
|
||||
if((type_info ~= nil) and (entity_info ~= nil)) then
|
||||
alerts_api.store(entity_info, type_info, alert.alert_tstamp)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue