From 83141c0aeeb78c161b82c4543b4c2ffb78691058 Mon Sep 17 00:00:00 2001
From: onefang
Date: Fri, 17 Jul 2020 02:50:44 +1000
Subject: No DNS-RR reports for IPv6 addreses if IPv6 is disabled.
Also some other stuff got mixed in with this.
---
apt-panopticon-report-email-web.lua | 64 ++++++++++++++++++++++---------------
1 file changed, 39 insertions(+), 25 deletions(-)
diff --git a/apt-panopticon-report-email-web.lua b/apt-panopticon-report-email-web.lua
index f293a4e..91a0efc 100755
--- a/apt-panopticon-report-email-web.lua
+++ b/apt-panopticon-report-email-web.lua
@@ -228,6 +228,7 @@ local makeTable = function(web, hosts)
if nil == v.Active then active = 'nil' else active = v.Active end
web:write("
" .. k .. " | ")
end
+ local inRR = "✅"
local ftp = "skip"
local http = status(hosts, k, results, "http")
local https = status(hosts, k, results, "https")
@@ -246,6 +247,14 @@ local makeTable = function(web, hosts)
if nil == rate then rate = '' end
-- DNS-RR test.
+-- if nil == http: find('OK') then inRR = "❌" end
+-- if nil == https: find('OK') then inRR = "❌" end
+-- if nil == protocol: find('OK') then inRR = "❌" end
+-- if nil == redirects: find('OK') then inRR = "❌" end
+-- if nil == sanity: find('OK') then inRR = "❌" end
+-- if nil == integrity: find('OK') then inRR = "❌" end
+-- if nil == updated: find('OK') then inRR = "❌" end
+
if (APT.options.roundRobin.value ~= k) and (nil ~= hosts[APT.options.roundRobin.value]) then
if 0 == max then
spd = ' | | '
@@ -294,6 +303,7 @@ local makeTable = function(web, hosts)
-- TODO - try to account for this better, this is just a quick hack.
end
week = ' ' .. percentUp .. '% up | ' .. percentUpdated .. '% updated | '
+-- if ('100.00' ~= percentUp) or ('100.00' ~= percentUpdated) then inRR = "❌" end
end
web:write("" .. ftp .. " | " .. http .. " | " .. https .. " | " .. rsync .. " | " .. dns ..
@@ -338,44 +348,48 @@ local makeIPlist = function(hosts)
if type(w) == "table" then
n[l] = {}
for i, u in pairs(w) do
- local inRR = ""
- local lc = logCount(k, i)
+ if (APT.testing("IPv6") and ("AAAA" == u)) or ("A" == u) then
+ local inRR = ""
+ local lc = logCount(k, i)
+ if checkRR then
+ -- If there where errors, warnings, or timeouts, then it'll have that wrapped in font tags.
+ inRR = "✅"
+ if nil ~= lc:find("❌"
+ if nil ~= RRbfile then
+ local f, e = RRbfile:write(i, '\n')
+ if f == nil then C("writing DNS-RR_bad.txt file - " .. e) end
+ end
+ elseif nil ~= RRgfile then
+ local f, e = RRgfile:write(i, '\n')
+ if f == nil then C("writing DNS-RR_good.txt file - " .. e) end
+ end
+ end
+ local log = '[graphs] '
+ if "" == log then n[l][i] = u else n[l][log .. inRR .. ' ' .. revDNS(hosts, k, i) .. ' ' .. lc] = u end
+ end
+ end
+ else
+ if (APT.testing("IPv6") and ("AAAA" == w)) or ("A" == w) then
+ local inRR = ""
+ local lc = logCount(k, l)
if checkRR then
-- If there where errors, warnings, or timeouts, then it'll have that wrapped in font tags.
inRR = "✅"
if nil ~= lc:find("❌"
if nil ~= RRbfile then
- local f, e = RRbfile:write(i, '\n')
+ local f, e = RRbfile:write(l, '\n')
if f == nil then C("writing DNS-RR_bad.txt file - " .. e) end
end
elseif nil ~= RRgfile then
- local f, e = RRgfile:write(i, '\n')
+ local f, e = RRgfile:write(l, '\n')
if f == nil then C("writing DNS-RR_good.txt file - " .. e) end
end
end
- local log = '[graphs] '
- if "" == log then n[l][i] = u else n[l][log .. inRR .. ' ' .. revDNS(hosts, k, i) .. ' ' .. lc] = u end
- end
- else
- local inRR = ""
- local lc = logCount(k, l)
- if checkRR then
- -- If there where errors, warnings, or timeouts, then it'll have that wrapped in font tags.
- inRR = "✅"
- if nil ~= lc:find("❌"
- if nil ~= RRbfile then
- local f, e = RRbfile:write(l, '\n')
- if f == nil then C("writing DNS-RR_bad.txt file - " .. e) end
- end
- elseif nil ~= RRgfile then
- local f, e = RRgfile:write(l, '\n')
- if f == nil then C("writing DNS-RR_good.txt file - " .. e) end
- end
+ local log = '[graphs] '
+ if "" == log then n[l] = w else n[log .. inRR .. ' ' .. revDNS(hosts, k, l) .. ' ' .. lc] = w end
end
- local log = '[graphs] '
- if "" == log then n[l] = w else n[log .. inRR .. ' ' .. revDNS(hosts, k, l) .. ' ' .. lc] = w end
end
end
end
--
cgit v1.1
|
---|