Score improvements

The score is now calculated differently on the client and on the server of the flow.
The hosts flow is updated every minute and charted.
It's now possible to trigger an alert when the score threshold is exceeded
This commit is contained in:
emanuele-f 2020-01-14 15:48:39 +01:00
parent 4a1d217d3a
commit d7528e1628
27 changed files with 209 additions and 114 deletions

View file

@ -15,7 +15,7 @@ local alert_consts = require("alert_consts")
-- @param flowstatus_info: the data passed in flow.triggerStatus by
-- the triggering user_script (user_scripts/flow/example.lua in this plugin).
-- @return a descriptive string of the flow status
local function formatExampleStatus(status, flowstatus_info)
local function formatExampleStatus(flowstatus_info)
local bad_port = flowstatus_info.bad_port
return i18n("example.status_invalid_port", {port_number = bad_port})
@ -29,13 +29,14 @@ return {
-- Third party users can safely use the dedicated IDs in range 59-63 .
status_id = 62,
-- The relevance of this status, used to calculate a score
-- prio: when a flow has multiple status set, the most important status is the one with highest priority
-- alert_type: the alert type associated to this status
-- alert_severity: the alert severity associated to this status
-- i18n_title: a localization string for the status
-- i18n_description (optional): a localization string / function for the description
relevance = 100,
-- score: the score of this status
-- prio: when a flow has multiple status set, the most important status is the one with highest priority
-- alert_type: the alert type associated to this status
-- alert_severity: the alert severity associated to this status
-- i18n_title: a localization string for the status
-- i18n_description (optional): a localization string / function for the description
cli_score = 100,
srv_score = 100,
-- A flow can have multiple statuses set. The predominant status is the one with the
-- histest "prio"