mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
RRD rework
This commit is contained in:
parent
0413516686
commit
31e26923b1
5 changed files with 68 additions and 95 deletions
|
|
@ -978,7 +978,10 @@ function makeRRD(basedir, ifname, rrdname, step, value)
|
|||
else
|
||||
create_rrd(name, step, rrdname)
|
||||
end
|
||||
|
||||
ntop.rrd_update(name, nil, tolongint(value))
|
||||
ntop.tsSet(ifname..":"..rrdname, tonumber(value), 0)
|
||||
|
||||
if(enable_second_debug) then
|
||||
io.write('Updating RRD ['.. ifname..'] '.. name .. " " .. value ..'\n')
|
||||
end
|
||||
|
|
@ -1070,14 +1073,13 @@ function touchRRD(rrdname)
|
|||
|
||||
if((last ~= nil) and ((now-last) > 3600)) then
|
||||
local tdiff = now - 1800 -- This avoids to set the update continuously
|
||||
local label = tdiff
|
||||
|
||||
if(ds_count == 1) then
|
||||
ntop.rrd_update(rrdname, tdiff, 0)
|
||||
elseif(ds_count == 2) then
|
||||
ntop.rrd_update(rrdname, tdiff, 0, 0)
|
||||
elseif(ds_count == 3) then
|
||||
ntop.rrd_update(rrdname, tdiff, 0, 0, 0)
|
||||
for i=1,ds_count do
|
||||
label = label .. ":0"
|
||||
end
|
||||
|
||||
ntop.rrd_update(rrdname, label)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue