Add option all in snmp device rules. (#7446)

This commit is contained in:
Nicolo Maio 2023-05-29 14:58:44 +00:00
parent 746749ef27
commit 6681e7717d
4 changed files with 51 additions and 15 deletions

View file

@ -117,6 +117,32 @@ http_lint.validateEmptyOr = validateEmptyOr
-- FRONT-END VALIDATORS
local function validateSNMPIfidNumber(p)
-- integer SNMP Ifid validation
if p == "*" then
return true
end
local num = tonumber(p)
if (num == nil) then
return false
end
if math.floor(num) == num then
return true
else
-- this is a float number
return false
end
end
http_lint.validateSNMPIfidNumber = validateSNMPIfidNumber
-- #################################################################
-- FRONT-END VALIDATORS
local function validateNumber(p)
-- integer number validation
local num = tonumber(p)
@ -1914,7 +1940,7 @@ local known_parameters = {
["flows_page_type"] = validateSingleWord,
["snmp_device"] = validateDevice,
["snmp_device_port"] = validateNumber,
["snmp_device_port"] = validateSNMPIfidNumber,
["snmp_device_port_label"] = validateUnquoted,
["snmp_device_label"] = validateUnquoted,
["snmp_threshold_value"] = validateNumber,