From 91b6eba0f7c4fd44dd79f0e868bb9e7a92bccce7 Mon Sep 17 00:00:00 2001 From: onefang Date: Tue, 31 Dec 2019 16:20:14 +1000 Subject: Add Redirects tests fully. --- apt-panopticommon.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'apt-panopticommon.lua') diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua index ca952d3..c03f817 100644 --- a/apt-panopticommon.lua +++ b/apt-panopticommon.lua @@ -4,7 +4,7 @@ local APT = {} APT.rrd = require 'rrd' APT.protocols = {"ftp", "http", "https", "rsync"} -APT.tests = {'raw', 'Integrity', 'Protocol', 'Updated', 'URLSanity', 'Speed'} +APT.tests = {'raw', 'Integrity', 'Protocol', 'Redirects', 'Updated', 'URLSanity', 'Speed'} APT.releases = {"jessie", "ascii", "beowulf", "ceres"} APT.subRels = {'backports', 'proposed-updates', 'security', 'updates'} APT.notExist = @@ -65,6 +65,7 @@ APT.options = -- "rsync", "DNSRR", "Protocol", + "Redirects", "URLSanity", "Integrity", "Updated", @@ -697,6 +698,9 @@ local DSIt = 'DS:IntegrityTimeouts:GAUGE:' .. hb .. ':0:U' local DSPe = 'DS:ProtocolErrors:GAUGE:' .. hb .. ':0:U' local DSPw = 'DS:ProtocolWarnings:GAUGE:' .. hb .. ':0:U' local DSPt = 'DS:ProtocolTimeouts:GAUGE:' .. hb .. ':0:U' +local DSRe = 'DS:RedirectsErrors:GAUGE:' .. hb .. ':0:U' +local DSRw = 'DS:RedirectsWarnings:GAUGE:' .. hb .. ':0:U' +local DSRt = 'DS:RedirectsTimeouts:GAUGE:' .. hb .. ':0:U' local DSUe = 'DS:UpdatedErrors:GAUGE:' .. hb .. ':0:U' local DSUw = 'DS:UpdatedWarnings:GAUGE:' .. hb .. ':0:U' local DSUt = 'DS:UpdatedTimeouts:GAUGE:' .. hb .. ':0:U' @@ -735,10 +739,11 @@ APT.createRRD = function(host, ip, o) os.execute( 'mkdir -p rrd/' .. host .. '/' .. p:upper()) 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, DSIt, DSPe, DSPw, DSPt, DSUe, DSUw, DSUt, DSSe, DSSw, DSSt, + APT.rrd.create( 'rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd', '--start', start, '--step', step, + DSIe, DSIw, DSIt, DSPe, DSPw, DSPt, DSRe, DSRw, DSRt, DSUe, DSUw, DSUt, DSSe, DSSw, DSSt, 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() .. '/Tests.rrd', (APT.now - 600) .. ':0:0:0:0:0:0:0:0:0:0:0:0') + APT.rrd.update( 'rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd', (APT.now - 600) .. ':0:0:0:0:0:0:0:0:0:0:0:0:0:0:0') end end os.execute( 'mkdir -p rrd/' .. host .. '/Speed') @@ -757,10 +762,11 @@ APT.updateRRD = function(results, host, ip) APT.rrd.update('rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd', APT.now .. ':' .. results[p]['Integrity'].errors .. ':' .. results[p]['Integrity'].warnings .. ':' .. results[p]['Integrity'].timeouts .. ':' .. results[p]['Protocol'].errors .. ':' .. results[p]['Protocol'].warnings .. ':' .. results[p]['Protocol'].timeouts .. ':' .. + results[p]['Redirects'].errors .. ':' .. results[p]['Redirects'].warnings .. ':' .. results[p]['Redirects'].timeouts .. ':' .. results[p]['Updated'].errors .. ':' .. results[p]['Updated'].warnings .. ':' .. results[p]['Updated'].timeouts .. ':' .. results[p]['URLSanity'].errors .. ':' .. results[p]['URLSanity'].warnings .. ':' .. results[p]['URLSanity'].timeouts) else - APT.rrd.update('rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd', APT.now .. ':U:U:U:U:U:U:U:U:U:U:U:U') + APT.rrd.update('rrd/' .. host .. '/' .. p:upper() .. '/Tests.rrd', APT.now .. ':U:U:U:U:U:U:U:U:U:U:U:U:U:U:U') end end if nil ~= results.speed then -- cgit v1.1