mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 07:59:35 +00:00
Avoids reset of builtin endpoints/recipients
This commit is contained in:
parent
1a8552549b
commit
6310dc1d8d
2 changed files with 14 additions and 22 deletions
|
|
@ -336,14 +336,18 @@ end
|
|||
-- @return Always return a table {status = "OK"}
|
||||
function notification_configs.reset_configs()
|
||||
for endpoint_key, endpoint in pairs(notification_configs.get_types()) do
|
||||
local k = string.format(ENDPOINT_CONFIGS_KEY, endpoint_key)
|
||||
local all_configs = ntop.getHashAllCache(k) or {}
|
||||
if not endpoint.builtin then
|
||||
local k = string.format(ENDPOINT_CONFIGS_KEY, endpoint_key)
|
||||
local all_configs = ntop.getHashAllCache(k) or {}
|
||||
|
||||
for conf_name, conf_params in pairs(all_configs) do
|
||||
notification_configs.delete_config(conf_name)
|
||||
for conf_name, conf_params in pairs(all_configs) do
|
||||
notification_configs.delete_config(conf_name)
|
||||
end
|
||||
|
||||
ntop.delCache(k)
|
||||
else
|
||||
tprint("skipping "..endpoint_key)
|
||||
end
|
||||
|
||||
ntop.delCache(k)
|
||||
end
|
||||
|
||||
return {status = "OK"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue