mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-06 03:45:26 +00:00
Implemented skeleton of CustomFlowLuaScriptAlert check
This commit is contained in:
parent
5f7bc4c542
commit
80db634bfe
15 changed files with 268 additions and 27 deletions
|
|
@ -93,7 +93,8 @@ local flow_alert_keys = {
|
|||
flow_alert_ndpi_http_obsolete_server = 84,
|
||||
flow_alert_ndpi_risky_asn = 85,
|
||||
flow_alert_ndpi_risky_domain = 86,
|
||||
|
||||
flow_alert_custom_lua_script = 87,
|
||||
|
||||
-- NOTE: for flow alerts not not go beyond the size of Bitmap alert_map inside Flow.h (currently 128)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
--
|
||||
-- (C) 2019-22 - ntop.org
|
||||
--
|
||||
|
||||
local checks = require("checks")
|
||||
local flow_consts = require("flow_consts")
|
||||
local alerts_api = require "alerts_api"
|
||||
local alert_consts = require("alert_consts")
|
||||
local flow_alert_keys = require "flow_alert_keys"
|
||||
|
||||
-- #################################################################
|
||||
|
||||
local script = {
|
||||
-- Script category
|
||||
category = checks.check_categories.security,
|
||||
|
||||
alert_id = flow_alert_keys.flow_alert_custom_lua_script,
|
||||
|
||||
gui = {
|
||||
i18n_title = "flow_checks_config.custom_lua_script",
|
||||
i18n_description = "flow_checks_config.custom_lua_script_description",
|
||||
}
|
||||
}
|
||||
|
||||
-- #################################################################
|
||||
|
||||
return script
|
||||
|
|
@ -43,7 +43,9 @@ function multi_threshold_cross:describeConfig(hooks_conf)
|
|||
local msg = ''
|
||||
|
||||
for field, value in pairs(configured_threshold) do
|
||||
msg = msg .. i18n(field) .. ": " .. value.threshold .. "%, "
|
||||
if(value.threshold ~= nil) then
|
||||
msg = msg .. i18n(field) .. ": " .. value.threshold .. "%, "
|
||||
end
|
||||
end
|
||||
|
||||
return msg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue