aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2019-12-12 13:53:04 +1000
committeronefang2019-12-12 13:53:04 +1000
commit5b134260ecb63381f413d1c6cebd045379c6cf1d (patch)
tree0420ae09fcb6962414857f594a11dbaa7c8b30c6
parentDon't need this comment anymore. (diff)
downloadapt-panopticon-5b134260ecb63381f413d1c6cebd045379c6cf1d.zip
apt-panopticon-5b134260ecb63381f413d1c6cebd045379c6cf1d.tar.gz
apt-panopticon-5b134260ecb63381f413d1c6cebd045379c6cf1d.tar.bz2
apt-panopticon-5b134260ecb63381f413d1c6cebd045379c6cf1d.tar.xz
Re-arrange the RRD data a little.
-rw-r--r--apt-panopticommon.lua33
1 files changed, 14 insertions, 19 deletions
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'
499APT.createRRD = function(host, ip) 499APT.createRRD = function(host, ip)
500 if nil ~= ip then host = host .. '_' .. ip end 500 if nil ~= ip then host = host .. '_' .. ip end
501 for i, p in pairs(APT.protocols) do 501 for i, p in pairs(APT.protocols) do
502-- for j, t in pairs(tests) do 502 os.execute( 'mkdir -p rrd/' .. host .. '/' .. p:upper())
503 os.execute( 'mkdir -p rrd/' .. host .. '/' .. p:upper()) 503 if not APT.checkFile('rrd/' .. host .. '/' .. p:upper() .. '/Speed.rrd') then
504 if not APT.checkFile('rrd/' .. host .. '/' .. p:upper() .. '/Speed.rrd') then 504 D('Creating ' .. 'rrd/' .. host .. '/' .. p:upper() .. '/Speed.rrd')
505 D('Creating ' .. 'rrd/' .. host .. '/' .. p:upper() .. '/Speed.rrd') 505 APT.rrd.create( 'rrd/' .. host .. '/' .. p:upper() .. '/Speed.rrd', '--start', start, '--step', step, DSx, DSn,
506-- if 'Speed' == t then 506 RRAc0, RRAc1, RRAc2, RRAl0, RRAc3, RRAc4, RRAc5, RRAl1, RRAc6, RRAc7, RRAc8, RRAl2, RRAc9, RRAc10, RRAc11, RRAl3, RRAc12, RRAc13, RRAc14, RRAl4)
507 APT.rrd.create( 'rrd/' .. host .. '/' .. p:upper() .. '/Speed.rrd', '--start', start, '--step', step, DSx, DSn, 507 end
508 RRAc0, RRAc1, RRAc2, RRAl0, RRAc3, RRAc4, RRAc5, RRAl1, RRAc6, RRAc7, RRAc8, RRAl2, RRAc9, RRAc10, RRAc11, RRAl3, RRAc12, RRAc13, RRAc14, RRAl4) 508 if not APT.checkFile('rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd') then
509-- else 509 D('Creating ' .. 'rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd')
510 end 510 APT.rrd.create( 'rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd', '--start', start, '--step', step, DSIe, DSIw, DSPe, DSPw, DSUe, DSUw, DSSe, DSSw,
511 if not APT.checkFile('rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd') then 511 RRAc0, RRAc1, RRAc2, RRAl0, RRAc3, RRAc4, RRAc5, RRAl1, RRAc6, RRAc7, RRAc8, RRAl2, RRAc9, RRAc10, RRAc11, RRAl3, RRAc12, RRAc13, RRAc14, RRAl4)
512 D('Creating ' .. 'rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd') 512 -- Start them at 0 so the average has something to work on.
513 APT.rrd.create( 'rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd', '--start', start, '--step', step, DSIe, DSIw, DSPe, DSPw, DSUe, DSUw, DSSe, DSSw, 513 APT.rrd.update( 'rrd/' .. host .. '/' .. p:upper() .. '/Speed.rrd', (APT.now - 600) .. ':0:0')
514 RRAc0, RRAc1, RRAc2, RRAl0, RRAc3, RRAc4, RRAc5, RRAl1, RRAc6, RRAc7, RRAc8, RRAl2, RRAc9, RRAc10, RRAc11, RRAl3, RRAc12, RRAc13, RRAc14, RRAl4) 514 APT.rrd.update( 'rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd', (APT.now - 600) .. ':0:0:0:0:0:0:0:0')
515-- end 515 end
516 -- Start them at 0 so the average has something to work on.
517 APT.rrd.update( 'rrd/' .. host .. '/' .. p:upper() .. '/Speed.rrd', (APT.now - 600) .. ':0:0')
518 APT.rrd.update( 'rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd', (APT.now - 600) .. ':0:0:0:0:0:0:0:0')
519 end
520-- end
521 end 516 end
522end 517end
523 518