RRD last now returns the DS count that is used to refresh the RRD before usage

This commit is contained in:
Luca Deri 2016-11-14 13:06:29 +01:00
parent 90547cffb1
commit 43a375dae2
2 changed files with 8 additions and 9 deletions

View file

@ -1023,17 +1023,16 @@ function singlerrd2json(ifid, host, rrdFile, start_time, end_time, rickshaw_json
-- results coming from different RRDs
local now = os.time()
local last = ntop.rrd_lastupdate(rrdname)
local last,ds_count = ntop.rrd_lastupdate(rrdname)
if((last ~= nil) and ((now-last) > 3600)) then
local tdiff = now - 1800 -- This avoids to set the uodate continuously
local tdiff = now - 1800 -- This avoids to set the update continuously
local label = tdiff
if(enable_second_debug == 1) then io.write("Updating "..rrdname.."\n") end
if rrdFile == "bytes.rrd" then
ntop.rrd_update(rrdname, tdiff..":0:0")
else
ntop.rrd_update(rrdname, tdiff..":0")
end
for i=1,ds_count do label = label .. ":0" end
ntop.rrd_update(rrdname, label)
end
--io.write(prefixLabel.."\n")