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
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
local user_scripts = require("user_scripts")
|
||||
local flow_consts = require("flow_consts")
|
||||
local alerts_api = require "alerts_api"
|
||||
local alert_consts = require("alert_consts")
|
||||
|
||||
local UNEXPECTED_PLUGINS_ENABLED_CACHE_KEY = "ntopng.cache.user_scripts.unexpected_plugins_enabled"
|
||||
|
||||
|
|
@ -57,15 +59,11 @@ function script.hooks.protocolDetected(now, conf)
|
|||
end
|
||||
|
||||
if ok == 0 then
|
||||
flow.triggerStatus(
|
||||
flow_consts.status_types.status_unexpected_smtp.create(
|
||||
flow_consts.status_types.status_unexpected_smtp.alert_severity,
|
||||
server_ip
|
||||
),
|
||||
100, -- flow_score
|
||||
0, -- cli_score
|
||||
100 --srv_score
|
||||
local unexpected_smtp_type = flow_consts.status_types.status_unexpected_smtp.create(
|
||||
server_ip
|
||||
)
|
||||
|
||||
alerts_api.trigger_status(unexpected_smtp_type, alert_consts.alert_severities.error, 0, 100, 100)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue