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

@ -4,9 +4,15 @@
local test_utils = {}
local alerts = require("alerts_api")
local test_failed_alert = alerts:newAlert({
type = "test_failed",
entity = "test"
severity = "error",
})
local function test_error(msg)
interface.storeAlert(alertEntity("test"), "test",
alertType("test_failed"), alertSeverity("error"), msg)
test_failed_alert:emit("test", msg)
end
local function test_assert(cond, error_msg)