Added ability to report ZMQ bps/pps as exported in latest nProbe

This commit is contained in:
Luca Deri 2016-04-24 15:05:06 +02:00
parent 08c908be2f
commit 89ea597be3
5 changed files with 22 additions and 11 deletions

View file

@ -25,7 +25,7 @@ function dumpInterfaceStats(interface_name)
hosts_pctg = math.floor(1+((ifstats.hosts*100)/prefs.max_num_hosts))
flows_pctg = math.floor(1+((ifstats.flows*100)/prefs.max_num_flows))
print('\t{ "ifname": "'.. interface_name..'", "packets": '.. ifstats.packets .. ', "bytes": ' .. ifstats.bytes .. ', "drops": ' .. ifstats.drops .. ', "alerts": '.. ntop.getNumQueuedAlerts() ..', "num_flows": '.. ifstats.flows .. ', "num_hosts": ' .. ifstats.hosts .. ', "epoch": ' .. os.time()..' , "uptime": " ' .. secondsToTime(uptime) .. '", "hosts_pctg": ' .. hosts_pctg .. ', "flows_pctg": ' .. flows_pctg)
print('\t{ "ifname": "'.. interface_name..'", "packets": '.. ifstats.packets .. ', "bytes": ' .. ifstats.bytes .. ', "drops": ' .. ifstats.drops .. ', "alerts": '.. ntop.getNumQueuedAlerts() ..', "num_flows": '.. ifstats.flows .. ', "num_hosts": ' .. ifstats.hosts .. ', "epoch": ' .. os.time()..' , "uptime": " ' .. secondsToTime(uptime) .. '", "hosts_pctg": ' .. hosts_pctg .. ', "flows_pctg": ' .. flows_pctg .. ', "remote_pps": ' .. ifstats.remote_pps ..', "remote_bps": ' .. ifstats.remote_bps)
print(', "is_view": '..tostring(ifstats.isView))
print(', "local2remote": '.. ifstats["localstats"]["bytes"]["local2remote"]..', "remote2local": '..ifstats["localstats"]["bytes"]["remote2local"])
@ -96,4 +96,4 @@ if(_GET["ifname"] == "all") then
print("\n]\n")
else
dumpInterfaceStats(ifname)
end
end