Alerts changes

NOTE: database schema changed. Existing alerts will be lost.

- Unified engaged and closed tables
- Simplified hosts engaged alert counters handling: periodically set by lua
- Removed alert engine and replaced with alert periodicity
- Now engage is implicitly derived from the alert end timestamp and periodicity
- New alerts_api.lua to easily emit alerts
- Removed past alerts counter aggregation by hash
- Alert notifications for non-flow alerts are now removed from C and triggered by lua
This commit is contained in:
emanuele-f 2019-06-28 10:43:13 +02:00
parent ae4770fe7d
commit a9d3c78587
30 changed files with 1055 additions and 1332 deletions

View file

@ -76,9 +76,8 @@ function dumpInterfaceStats(interface_name)
end
if prefs.are_alerts_enabled == true then
local alert_cache = interface.getCachedNumAlerts() or {}
res["engaged_alerts"] = alert_cache["num_alerts_engaged"] or 0
res["alerts_stored"] = alert_cache["alerts_stored"] or 0
res["engaged_alerts"] = ifstats["num_alerts_engaged"] or 0
res["has_alerts"] = ifstats["has_alerts"]
res["ts_alerts"] = {}
if ts_utils.getDriverName() == "influxdb" and system_scripts.hasAlerts({entity = alertEntity("influx_db")}) then