mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Implements Flow Devices statistics collection and storage
Flows sent via nProbe (proxy mode) carry information on the exporter address (EXPORTER_IPV4_ADDRESS) and on the exporter interfaces (INPUT_SNMP and OUTPUT_SNMP). This implementation attempts at saving this information to allow comparisons with raw SNMP data.
This commit is contained in:
parent
ff87d8922d
commit
13613fc2da
10 changed files with 113 additions and 50 deletions
|
|
@ -199,6 +199,9 @@ function getRRDName(ifid, host_or_network, rrdFile)
|
|||
host_or_network = string.gsub(host_or_network, 'snmp:', '')
|
||||
-- snmpstats are ntopng-wide so ifid is ignored
|
||||
rrdname = fixPath(dirs.workingdir .. "/snmpstats/")
|
||||
elseif host_or_network ~= nil and string.starts(host_or_network, 'flow_device:') then
|
||||
host_or_network = string.gsub(host_or_network, 'flow_device:', '')
|
||||
rrdname = fixPath(dirs.workingdir .. "/" .. ifid .. "/flow_devices/")
|
||||
elseif host_or_network ~= nil and string.starts(host_or_network, 'asn:') then
|
||||
host_or_network = string.gsub(host_or_network, 'asn:', '')
|
||||
rrdname = fixPath(dirs.workingdir .. "/" .. ifid .. "/asnstats/")
|
||||
|
|
@ -1095,6 +1098,7 @@ function singlerrd2json(ifid, host, rrdFile, start_time, end_time, rickshaw_json
|
|||
touchRRD(rrdname)
|
||||
|
||||
--io.write(prefixLabel.."\n")
|
||||
|
||||
if(prefixLabel == "Bytes" or string.starts(rrdFile, 'categories/')) then
|
||||
prefixLabel = "Traffic"
|
||||
end
|
||||
|
|
@ -1129,7 +1133,7 @@ function singlerrd2json(ifid, host, rrdFile, start_time, end_time, rickshaw_json
|
|||
|
||||
-- Pretty printing for flowdevs/a.b.c.d/e.rrd
|
||||
local elems = split(prefixLabel, "/")
|
||||
if((elems[#elems] ~= nil) and (#elems > 1)) then
|
||||
if(not host:starts('flow_device:') and (elems[#elems] ~= nil) and (#elems > 1)) then
|
||||
prefixLabel = "Port "..elems[#elems]
|
||||
port_mode = true
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue