Saves Local Network Statistics to RRDs

Local Network Statistics (ingress, egress, and inner bytes)
are saved to RRD files. Web visualizations can be obtained from these RRDS.
This commit is contained in:
Simone Mainardi 2015-11-05 17:19:54 +01:00
parent e7ff1687e0
commit 595b2989c8
3 changed files with 52 additions and 9 deletions

View file

@ -31,7 +31,7 @@ end
network_name = ntop.getNetworkNameById(tonumber(network))
rrdname = dirs.workingdir .. "/" .. ifId .. "/rrd/" .. getPathFromKey(network_name) .. "/bytes.rrd"
rrdname = dirs.workingdir .. "/" .. ifId .. "/subnetstats/" .. getPathFromKey(network_name) .. "/bytes.rrd"
if(not ntop.exists(rrdname)) then
print("<div class=\"alert alert alert-danger\"><img src=".. ntop.getHttpPrefix() .. "/img/warning.png> No available stats for network "..network_name.."</div>")
@ -63,6 +63,6 @@ else
end
host_url = ntop.getHttpPrefix()..'/lua/network_details.lua?ifname='..ifId..'&network='..network..'&page=historical'
drawRRD(ifId, network_name, rrdfile, _GET["graph_zoom"], host_url, 1, _GET["epoch"], nil, makeTopStatsScriptsArray())
drawRRD(ifId, 'net:'..network_name, rrdfile, _GET["graph_zoom"], host_url, 1, _GET["epoch"], nil, makeTopStatsScriptsArray())
dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")