mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
Implements add the ability to suppress specific alerts
Implements #4942 Partially implemented alerts exclusion list Added User Script exclusion list to settings Implements add the ability to suppress specific alerts Implements #4942
This commit is contained in:
parent
e1984cb886
commit
769658268f
14 changed files with 474 additions and 22 deletions
|
|
@ -27,6 +27,7 @@ local subdir = _POST["script_subdir"]
|
|||
local confset_id = tonumber(_POST["confset_id"] or user_scripts.DEFAULT_CONFIGSET_ID)
|
||||
local script_key = _POST["script_key"]
|
||||
local alert_severity = _POST['alert_severity']
|
||||
local alert_exclusion_list = _POST['alert_exclusion_list']
|
||||
|
||||
-- ################################################
|
||||
|
||||
|
|
@ -62,13 +63,27 @@ end
|
|||
-- ################################################
|
||||
|
||||
local result = {}
|
||||
local success = false
|
||||
local err = ""
|
||||
|
||||
local additional_params = {}
|
||||
if alert_severity ~= nil then
|
||||
additional_params.severity = alert_consts.alertSeverityById(alert_severity)
|
||||
end
|
||||
|
||||
local success, err = user_scripts.updateScriptConfig(confset_id, script_key, subdir, data, additional_params)
|
||||
local additional_filters = {}
|
||||
if alert_exclusion_list ~= nil then
|
||||
success, additional_filters = user_scripts.parseFilterParams(alert_exclusion_list)
|
||||
|
||||
if not success then
|
||||
err = additional_filters
|
||||
goto response
|
||||
end
|
||||
end
|
||||
|
||||
success, err = user_scripts.updateScriptConfig(confset_id, script_key, subdir, data, additional_params, additional_filters, true)
|
||||
|
||||
::response::
|
||||
|
||||
result.success = success
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue