mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
parent
3337067d73
commit
f0c55acae8
3 changed files with 42 additions and 8 deletions
|
|
@ -89,10 +89,25 @@ end
|
|||
|
||||
-- ##############################################
|
||||
|
||||
function getProbeName(exporter_ip, show_vlan, shorten_len)
|
||||
function getProbeName(exporter_ip, show_vlan, shorten_len, show_ip_and_alias)
|
||||
-- Set default to true if nil to show ip [alias]
|
||||
if show_ip_and_alias == nil then
|
||||
show_ip_and_alias = true
|
||||
end
|
||||
|
||||
local cached_device_name
|
||||
local snmp_cached_dev
|
||||
|
||||
local probe_alias = ""
|
||||
|
||||
-- if show_ip_and_alias == false only returns the alias
|
||||
local probe_alias = getFlowDevAlias(exporter_ip, show_ip_and_alias)
|
||||
|
||||
-- In case an alias is set to the flow exporter, directly use the alias
|
||||
if not isEmptyString(probe_alias) and probe_alias ~= exporter_ip then
|
||||
return probe_alias
|
||||
end
|
||||
|
||||
-- No alias set, let's try with the SNMP
|
||||
if ntop.isPro() then
|
||||
local dirs = ntop.getDirs()
|
||||
|
|
@ -1037,7 +1052,7 @@ end
|
|||
function getFlowDevAlias(flowdev_ip, add_id)
|
||||
local alias = ntop.getHashCache(getFlowDevAliasKey(), flowdev_ip)
|
||||
local ret
|
||||
|
||||
|
||||
if not isEmptyString(alias) then
|
||||
if (add_id == true) then
|
||||
ret = flowdev_ip .. " [" .. alias .. "]"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue