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 ++++++++++---- apt-panopticon-report-email-web.lua | 7 +++++-- apt-panopticon.lua | 4 ++-- explanations.html | 6 ++++++ 4 files changed, 23 insertions(+), 8 deletions(-) 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 diff --git a/apt-panopticon-report-email-web.lua b/apt-panopticon-report-email-web.lua index 05699ee..3365d78 100755 --- a/apt-panopticon-report-email-web.lua +++ b/apt-panopticon-report-email-web.lua @@ -212,7 +212,8 @@ end local makeTable = function(web, hosts) web:write("
" .. lnk('FTP') .. " | " .. lnk('HTTP') .. " | " .. lnk('HTTPS') .. " | " .. lnk('RSYNC') .. " | " .. - "" .. lnk('DNS round robin', 'DNS-RR') .. " | " .. lnk('Protocol') .. " | " .. lnk('URL sanity', 'URL-Sanity') .. " | " .. lnk('Integrity') .. " | " .. + "" .. lnk('DNS round robin', 'DNS-RR') .. " | " .. lnk('Protocol') .. " | " .. lnk('Redirects') .. + " | " .. lnk('URL sanity', 'URL-Sanity') .. " | " .. lnk('Integrity') .. " | " .. "" .. lnk('Updated') .. " | " .. lnk('Speed range', 'Speed') .. " | " .. "" .. lnk('Weekly statistics', 'Weekly') .. " | " .. lnk('Graphs') .. " | " .. ftp .. " | " .. http .. " | " .. https .. " | " .. rsync .. " | " .. dns .. - " | " .. protocol .. " | " .. sanity .. " | " .. integrity .. " | " .. '' .. rate .. + " | " .. protocol .. " | " .. redirects .. " | " .. sanity .. " | " .. integrity .. " | " .. '' .. rate .. ' | ' .. updated .. ' | ' .. spd .. " " .. week .."" .. graph .. " | \n") if "" ~= active then web:write("
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
" .. active .. " |