mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
Fixes netflow devices c++ function not working
This commit is contained in:
parent
f8600d4e9d
commit
72ced2fcfd
10 changed files with 121 additions and 74 deletions
|
|
@ -77,8 +77,8 @@ function getProbesName(flowdevs, show_vlan, shorten_len)
|
|||
for interface, devices in pairs(flowdevs or {}) do
|
||||
local device_list = {}
|
||||
if table.len(devices or {}) > 0 then
|
||||
for ip, _ in pairsByValues(devices or {}, asc) do
|
||||
device_list[ip] = getProbeName(ip, show_vlan, shorten_len)
|
||||
for id, device_info in pairsByValues(devices or {}, asc) do
|
||||
device_list[device_info.exporter_ip] = getProbeName(device_info.exporter_ip, show_vlan, shorten_len)
|
||||
end
|
||||
probes_list[interface] = device_list
|
||||
end
|
||||
|
|
@ -1222,6 +1222,22 @@ function mapServiceName(port, protocol)
|
|||
return(services[key])
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
function getExporterList()
|
||||
local flowdevs = interface.getFlowDevices()
|
||||
local unified_exporters = {}
|
||||
for interface_id, device_list in pairs(flowdevs or {}) do
|
||||
for device_id, exporter_info in pairs(device_list, asc) do
|
||||
local exporter_ip = exporter_info.exporter_ip
|
||||
if not unified_exporters[exporter_ip] then
|
||||
unified_exporters[exporter_ip] = exporter_info
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return unified_exporters
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue