mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-03 09:20:10 +00:00
Modified flow scripts in view of the new trigger_status (#4710)
* Modified blacklisted script in view of the new flow_script API * Modified plugins scripting in view of the new API * Modified flow scripts with the new trigger API * Fixed creators severity Co-authored-by: matteo <biscosi@ntop.org>
This commit is contained in:
parent
283bd7179c
commit
0e341f3d0b
50 changed files with 146 additions and 209 deletions
|
|
@ -2,7 +2,9 @@
|
|||
-- (C) 2019-20 - ntop.org
|
||||
--
|
||||
|
||||
local alerts_api = require "alerts_api"
|
||||
local flow_consts = require("flow_consts")
|
||||
local alert_consts = require("alert_consts")
|
||||
|
||||
-- #################################################################
|
||||
|
||||
|
|
@ -21,15 +23,12 @@ local handler = {}
|
|||
function handler.handle_risk(risk_id, flow_score, cli_score, srv_score)
|
||||
-- Set a flow status for the generic flow_risk. This will also
|
||||
-- cause an alert to be generated.
|
||||
flow.triggerStatus(
|
||||
flow_consts.status_types.status_flow_risk.create(
|
||||
flow_consts.status_types.status_flow_risk.alert_severity,
|
||||
risk_id
|
||||
),
|
||||
flow_score or 0, -- flow_score
|
||||
cli_score or 0, -- cli_score
|
||||
srv_score or 0 -- srv_score
|
||||
local flow_risk_type = flow_consts.status_types.status_flow_risk.create(
|
||||
risk_id
|
||||
)
|
||||
|
||||
alerts_api.trigger_status(flow_risk_type, alert_consts.alert_severities.warning, cli_score or 0, srv_score or 0, flow_score or 0)
|
||||
|
||||
end
|
||||
|
||||
-- #################################################################
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue