mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 07:59:35 +00:00
Fixed Lua error in discovery
This commit is contained in:
parent
6811bdae95
commit
cb54b9717c
1 changed files with 17 additions and 0 deletions
|
|
@ -758,6 +758,21 @@ end
|
|||
|
||||
-- #############################################################################
|
||||
|
||||
function discovery2config(interface_name)
|
||||
local cached = ntop.getCache(discover.getCachedDiscoveryKey(interface_name))
|
||||
local disc = json.decode(cached)
|
||||
|
||||
if(disc) then
|
||||
for _,dev in pairs(disc.devices) do
|
||||
if(dev.device_type.."" ~= "unknown") then
|
||||
io.write(dev.mac .. " = " .. dev.device_type .. "\n")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- #############################################################################
|
||||
|
||||
function discover.discover2table(interface_name, recache)
|
||||
local snmp_community = ntop.getPref("ntopng.prefs.default_snmp_community")
|
||||
|
||||
|
|
@ -767,6 +782,8 @@ function discover.discover2table(interface_name, recache)
|
|||
|
||||
interface.select(interface_name)
|
||||
|
||||
discovery2config(interface_name)
|
||||
|
||||
if recache ~= true then
|
||||
local cached = ntop.getCache(discover.getCachedDiscoveryKey(interface_name))
|
||||
if not isEmptyString(cached) then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue