Migrate C flow status alerts to Lua user scripts

- Alerts and flow status cleanup
- Community flow user scripts migration
- Implement scripts filters by l7 proto and packet interface only
- Migrate flow2statusinfojson
- Lower flow periodic update to 30 seconds if there is flow activity
- Display flow scripts without a gui section
This commit is contained in:
emanuele-f 2019-10-17 17:37:15 +02:00
parent bfdf5773d3
commit b3a8c6d49a
37 changed files with 1071 additions and 1287 deletions

View file

@ -2391,33 +2391,6 @@ end
-- ###############################################
-- NOTE: "flowstatus_info" is a lua table in a common format used
-- to dump accurate flow alert information. See flow2statusinfo and alert2statusinfo
-- below.
-- Uses a flow returned by interface.getFlowsInfo() to create a flowstatus_info.
-- NOTE: Keep consistent with alert2statusinfo
function flow2statusinfo(flow)
if flow["status_info"] then
local json = require("dkjson")
local res = json.decode(flow["status_info"])
return res
end
return nil
end
-- Uses an alert json to create a flowstatus_info.
-- NOTE: Keep consistent with flow2statusinfo
function alert2statusinfo(flow_json)
local res = table.clone(flow_json.status_info)
return res
end
-- ###############################################
function formatElephantFlowStatus(status, flowstatus_info, local2remote)
local threshold = ""
local res = ""