Updated rrd_exists() for checking existance of SNMP rrd archives

This commit is contained in:
Luca Deri 2017-03-04 08:53:28 +01:00
parent e838c3ed49
commit 50aea3f40e

View file

@ -2051,6 +2051,12 @@ function rrd_exists(host_ip, rrdname)
if(host_ip == nil) then return false end
dirs = ntop.getDirs()
rrdpath = dirs.workingdir .. "/" .. ifId .. "/rrd/" .. getPathFromKey(host_ip) .. "/" .. rrdname
if(ntop.exists(rrdpath)) then return true end
-- Let's now try SNMP counters
rrdpath = dirs.workingdir .. "/" .. ifId .. "/snmpstats/" .. getPathFromKey(host_ip) .. "/" .. rrdname
-- print(rrdpath)
return ntop.exists(rrdpath)
end