mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-05 10:41:34 +00:00
Refactors alert_severities into an independend Lua module
This commit is contained in:
parent
e683509dec
commit
b3dc39c641
109 changed files with 317 additions and 264 deletions
|
|
@ -10,13 +10,14 @@ 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
|
||||
local threshold = tonumber(params.user_script_config.threshold)
|
||||
local drop_perc = math.min(stats.drops * 100.0 / (stats.drops + stats.packets + 1), 100)
|
||||
local drops_type = alert_consts.alert_types.alert_too_many_drops.create(
|
||||
alert_consts.alert_severities.error,
|
||||
alert_severities.error,
|
||||
alert_consts.alerts_granularities.min,
|
||||
stats.drops,
|
||||
drop_perc,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue