mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-01 00:19:33 +00:00
Add support for on/off alert configuration
This commit is contained in:
parent
c1b114e151
commit
3ab6ff7901
3 changed files with 30 additions and 2 deletions
|
|
@ -244,6 +244,12 @@ local function validateOperator(mode)
|
|||
return validateChoice(modes, mode)
|
||||
end
|
||||
|
||||
local function validateAlertValue(value)
|
||||
return validateEmpty(value) or
|
||||
validateNumber(value) or
|
||||
validateOnOff(value)
|
||||
end
|
||||
|
||||
local function validateHttpMode(mode)
|
||||
local modes = {"responses", "queries"}
|
||||
|
||||
|
|
@ -1517,7 +1523,7 @@ local special_parameters = { --[[Suffix validator]] --[[Value Validator]]
|
|||
|
||||
-- ALERTS (see alert_utils.lua)
|
||||
["op_"] = { validateAlertDescriptor, validateOperator }, -- key: an alert descriptor, value: alert operator
|
||||
["value_"] = { validateAlertDescriptor, validateEmptyOr(validateNumber) }, -- key: an alert descriptor, value: alert value
|
||||
["value_"] = { validateAlertDescriptor, validateAlertValue }, -- key: an alert descriptor, value: alert value
|
||||
["slack_ch_"] = { validateNumber, validateSingleWord }, -- slack channel name
|
||||
|
||||
-- Protocol to categories match
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue