Added to double severity alert, single default alert

Implements #4919
This commit is contained in:
Matteo Biscosi 2021-01-28 18:17:27 +01:00
parent 055fbd5589
commit b1134b611f
7 changed files with 34 additions and 16 deletions

View file

@ -5,13 +5,13 @@
local alerts_api = require("alerts_api")
local user_scripts = require("user_scripts")
local alert_consts = require("alert_consts")
local alert_severities = require "alert_severities"
local script
-- #################################################################
local function check_interface_drops(params)
local alert_severities = require "alert_severities"
local alert_consts = require "alert_consts"
local info = params.entity_info
local stats = info.stats_since_reset
@ -24,7 +24,7 @@ local function check_interface_drops(params)
threshold
)
alert:set_severity(alert_severities.error)
alert:set_severity(params.user_script_config.severity)
alert:set_granularity(params.granularity)
if((stats.packets > 100) and (drop_perc > threshold)) then
@ -45,6 +45,7 @@ script = {
-- "> 5%"
operator = "gt",
threshold = 5,
severity = alert_severities.error,
},
-- This script is only for alerts generation