mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-03 09:20:10 +00:00
Optimized redis requests
This commit is contained in:
parent
c6f49f7e4c
commit
24b5232546
2 changed files with 15 additions and 6 deletions
|
|
@ -89,6 +89,8 @@ end
|
|||
|
||||
-- ##############################################
|
||||
|
||||
local probes_names = {}
|
||||
|
||||
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
|
||||
|
|
@ -101,11 +103,12 @@ function getProbeName(exporter_ip, show_vlan, shorten_len, show_ip_and_alias)
|
|||
|
||||
local cached_device_name
|
||||
local snmp_cached_dev
|
||||
local probe_alias = probes_names[exporter_ip]
|
||||
|
||||
local probe_alias = ""
|
||||
|
||||
-- if show_ip_and_alias == false only returns the alias
|
||||
local probe_alias = getFlowDevAlias(exporter_ip, show_ip_and_alias)
|
||||
if (not probe_alias) then
|
||||
probe_alias = getFlowDevAlias(exporter_ip, show_ip_and_alias)
|
||||
probes_names[exporter_ip] = probe_alias or ""
|
||||
end
|
||||
|
||||
-- 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue