From 5b134260ecb63381f413d1c6cebd045379c6cf1d Mon Sep 17 00:00:00 2001 From: onefang Date: Thu, 12 Dec 2019 13:53:04 +1000 Subject: Re-arrange the RRD data a little. --- apt-panopticommon.lua | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) (limited to 'apt-panopticommon.lua') diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua index d3139ae..5c0dfe3 100644 --- a/apt-panopticommon.lua +++ b/apt-panopticommon.lua @@ -499,25 +499,20 @@ local RRAl4 = 'RRA:LAST:0.9:2635:1201' APT.createRRD = function(host, ip) if nil ~= ip then host = host .. '_' .. ip end for i, p in pairs(APT.protocols) do --- for j, t in pairs(tests) do - os.execute( 'mkdir -p rrd/' .. host .. '/' .. p:upper()) - if not APT.checkFile('rrd/' .. host .. '/' .. p:upper() .. '/Speed.rrd') then - D('Creating ' .. 'rrd/' .. host .. '/' .. p:upper() .. '/Speed.rrd') --- if 'Speed' == t then - APT.rrd.create( 'rrd/' .. host .. '/' .. p:upper() .. '/Speed.rrd', '--start', start, '--step', step, DSx, DSn, - RRAc0, RRAc1, RRAc2, RRAl0, RRAc3, RRAc4, RRAc5, RRAl1, RRAc6, RRAc7, RRAc8, RRAl2, RRAc9, RRAc10, RRAc11, RRAl3, RRAc12, RRAc13, RRAc14, RRAl4) --- else - end - if not APT.checkFile('rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd') then - D('Creating ' .. 'rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd') - APT.rrd.create( 'rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd', '--start', start, '--step', step, DSIe, DSIw, DSPe, DSPw, DSUe, DSUw, DSSe, DSSw, - RRAc0, RRAc1, RRAc2, RRAl0, RRAc3, RRAc4, RRAc5, RRAl1, RRAc6, RRAc7, RRAc8, RRAl2, RRAc9, RRAc10, RRAc11, RRAl3, RRAc12, RRAc13, RRAc14, RRAl4) --- end - -- Start them at 0 so the average has something to work on. - APT.rrd.update( 'rrd/' .. host .. '/' .. p:upper() .. '/Speed.rrd', (APT.now - 600) .. ':0:0') - APT.rrd.update( 'rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd', (APT.now - 600) .. ':0:0:0:0:0:0:0:0') - end --- end + os.execute( 'mkdir -p rrd/' .. host .. '/' .. p:upper()) + if not APT.checkFile('rrd/' .. host .. '/' .. p:upper() .. '/Speed.rrd') then + D('Creating ' .. 'rrd/' .. host .. '/' .. p:upper() .. '/Speed.rrd') + APT.rrd.create( 'rrd/' .. host .. '/' .. p:upper() .. '/Speed.rrd', '--start', start, '--step', step, DSx, DSn, + RRAc0, RRAc1, RRAc2, RRAl0, RRAc3, RRAc4, RRAc5, RRAl1, RRAc6, RRAc7, RRAc8, RRAl2, RRAc9, RRAc10, RRAc11, RRAl3, RRAc12, RRAc13, RRAc14, RRAl4) + end + if not APT.checkFile('rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd') then + D('Creating ' .. 'rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd') + APT.rrd.create( 'rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd', '--start', start, '--step', step, DSIe, DSIw, DSPe, DSPw, DSUe, DSUw, DSSe, DSSw, + RRAc0, RRAc1, RRAc2, RRAl0, RRAc3, RRAc4, RRAc5, RRAl1, RRAc6, RRAc7, RRAc8, RRAl2, RRAc9, RRAc10, RRAc11, RRAl3, RRAc12, RRAc13, RRAc14, RRAl4) + -- Start them at 0 so the average has something to work on. + APT.rrd.update( 'rrd/' .. host .. '/' .. p:upper() .. '/Speed.rrd', (APT.now - 600) .. ':0:0') + APT.rrd.update( 'rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd', (APT.now - 600) .. ':0:0:0:0:0:0:0:0') + end end end -- cgit v1.1