mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-03 09:20:10 +00:00
Implemented lua caching to speedump hostname and interface mapping lookup
This commit is contained in:
parent
8d13fe3411
commit
e0e4e8ea96
11 changed files with 817 additions and 600 deletions
|
|
@ -13,6 +13,7 @@ pragma_once_lua_utils_get = true
|
|||
require "ntop_utils"
|
||||
require "label_utils"
|
||||
require "check_redis_prefs"
|
||||
local cache_utils = require "cache_utils"
|
||||
|
||||
local clock_start = os.clock()
|
||||
local snmp_cached_devices = {}
|
||||
|
|
@ -97,11 +98,19 @@ function getProbeName(exporter_ip, show_vlan, shorten_len, show_ip_and_alias)
|
|||
if show_ip_and_alias == nil then
|
||||
show_ip_and_alias = true
|
||||
end
|
||||
|
||||
|
||||
if tonumber(exporter_ip) then
|
||||
exporter_ip = ntop.inet_ntoa(exporter_ip)
|
||||
end
|
||||
|
||||
if(exporter_ip ~= nil) then
|
||||
local ret = cache_utils.gethostname(exporter_ip)
|
||||
|
||||
if(not isEmptyString(ret)) then
|
||||
return(ret)
|
||||
end
|
||||
end
|
||||
|
||||
local cached_device_name
|
||||
local snmp_cached_dev
|
||||
local probe_alias = probes_names[exporter_ip]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue