Implements periodic alerts rotation

Oldest alerts are periodically overwritten by newest ones
when a certain (user-configurable) threshold has been exceeded.
Rotation is performed periodically in a housekeeping.lua
This commit is contained in:
Simone Mainardi 2017-01-17 15:15:23 +01:00
parent 107b4543a5
commit e8cffe9227
7 changed files with 96 additions and 11 deletions

View file

@ -195,17 +195,16 @@ function printAlerts()
showElements = false
end
--[[ disabled, due to efficiency reasons limits are honoured only for flow alerts
prefsInputFieldPrefs("Maximum Number of Alerts per Entity",
"The maximum number of alerts per alarmable entity. Alarmable entities are hosts, networks, interfaces and flows. "..
"Once the maximum number of entity alerts is reached, oldest alerts will be overwritten. "..
"Default: 1024.", "ntopng.prefs.", "max_num_alerts_per_entity", prefs.max_num_alerts_per_entity, nil, showElements, false)
--]]
if show_advanced_prefs then
"Default: 1024.", "ntopng.prefs.", "max_num_alerts_per_entity", prefs.max_num_alerts_per_entity, "number", showElements, false, nil, {min=1, --[[ TODO check min/max ]]})
prefsInputFieldPrefs("Maximum Number of Flow Alerts",
"The maximum number of flow alerts. Once the maximum number of alerts is reached, oldest alerts will be overwritten. "..
"Default: 16384.", "ntopng.prefs.", "max_num_flow_alerts", prefs.max_num_flow_alerts, "number", showElements, false, nil, {min=1, --[[ TODO check min/max ]]})
end
toggleTableButtonPrefs("Enable Probing Alerts",
"Enable alerts generated when probing attempts are detected.",
"On", "1", "success",