mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
Implements #5587 behavior analysis enabled by the alerts
This commit is contained in:
parent
2b58ed6708
commit
17cd2efb00
14 changed files with 89 additions and 101 deletions
|
|
@ -2,7 +2,10 @@
|
|||
-- (C) 2020-21 - ntop.org
|
||||
--
|
||||
|
||||
local rest_utils = require("rest_utils")
|
||||
|
||||
local behavior_utils = {}
|
||||
local redis_key = "changed_behavior_alert_setup"
|
||||
|
||||
-- ##############################################
|
||||
|
||||
|
|
@ -33,6 +36,29 @@ function behavior_utils.get_behavior_timeseries_utils(family_key)
|
|||
return behavior_table[family_key]
|
||||
end
|
||||
|
||||
function behavior_utils.change_behavior_alert_status()
|
||||
-- Set the redis key for the restart
|
||||
ntop.setCache(redis_key, true)
|
||||
rest_utils.answer(rest_utils.consts.success.ok, res)
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
function behavior_utils.restart_required()
|
||||
if ntop.getCache(redis_key) == '' then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
function behavior_utils.reset()
|
||||
if ntop.getCache(redis_key) ~= '' then
|
||||
ntop.delCache(redis_key)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return behavior_utils
|
||||
Loading…
Add table
Add a link
Reference in a new issue