mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Refactors snmp_utils global methods into module functions
This commit is contained in:
parent
8a3e65ac50
commit
0bbb30e13e
11 changed files with 47 additions and 35 deletions
|
|
@ -30,14 +30,18 @@ end
|
|||
-- #######################################################
|
||||
|
||||
local function snmpPortDuplexChangeFormatter(ifid, alert, info)
|
||||
if ntop.isPro() then local snmp_utils = require "snmp_utils" end
|
||||
local snmp_utils
|
||||
|
||||
if ntop.isPro() then
|
||||
snmp_utils = require "snmp_utils"
|
||||
end
|
||||
|
||||
return(i18n("alerts_dashboard.snmp_port_changed_duplex_status",
|
||||
{device = info.device,
|
||||
port = info.interface_name or info.interface,
|
||||
url = snmpDeviceUrl(info.device),
|
||||
port_url = snmpIfaceUrl(info.device, info.interface),
|
||||
new_op = snmp_duplexstatus(info.status)}))
|
||||
new_op = snmp_utils.snmp_duplexstatus(info.status)}))
|
||||
end
|
||||
|
||||
-- #######################################################
|
||||
|
|
|
|||
|
|
@ -30,14 +30,18 @@ end
|
|||
-- #######################################################
|
||||
|
||||
local function portStatusChangeFormatter(ifid, alert, info)
|
||||
if ntop.isPro() then local snmp_utils = require "snmp_utils" end
|
||||
local snmp_utils
|
||||
|
||||
if ntop.isPro() then
|
||||
snmp_utils = require "snmp_utils"
|
||||
end
|
||||
|
||||
return(i18n("alerts_dashboard.snmp_port_changed_operational_status",
|
||||
{device = info.device,
|
||||
port = info.interface_name or info.interface,
|
||||
url = snmpDeviceUrl(info.device),
|
||||
port_url = snmpIfaceUrl(info.device, info.interface),
|
||||
new_op = snmp_ifstatus(info.status)}))
|
||||
new_op = snmp_utils.snmp_ifstatus(info.status)}))
|
||||
end
|
||||
|
||||
-- #######################################################
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue