mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-01 00:19:33 +00:00
Add option all in snmp device rules. (#7446)
This commit is contained in:
parent
746749ef27
commit
6681e7717d
4 changed files with 51 additions and 15 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue