Browse Source

No DNS-RR reports for IPv6 addreses if IPv6 is disabled.

Also some other stuff got mixed in with this.
master
onefang 9 months ago
parent
commit
83141c0aee
1 changed files with 39 additions and 25 deletions
  1. +39
    -25
      apt-panopticon-report-email-web.lua

+ 39
- 25
apt-panopticon-report-email-web.lua View File

@@ -228,6 +228,7 @@ local makeTable = function(web, hosts)
if nil == v.Active then active = 'nil' else active = v.Active end
web:write(" <tr style='background-color:dimgrey'><th>" .. k .. "</th> ")
end
local inRR = "<font color='green'><b>&#x2705;</b></font>"
local ftp = "<font color='grey'><b>skip</b></font>"
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 = "<font color='red'>&#x274c;</font>" end
-- if nil == https: find('OK') then inRR = "<font color='red'>&#x274c;</font>" end
-- if nil == protocol: find('OK') then inRR = "<font color='red'>&#x274c;</font>" end
-- if nil == redirects: find('OK') then inRR = "<font color='red'>&#x274c;</font>" end
-- if nil == sanity: find('OK') then inRR = "<font color='red'>&#x274c;</font>" end
-- if nil == integrity: find('OK') then inRR = "<font color='red'>&#x274c;</font>" end
-- if nil == updated: find('OK') then inRR = "<font color='red'>&#x274c;</font>" end

if (APT.options.roundRobin.value ~= k) and (nil ~= hosts[APT.options.roundRobin.value]) then
if 0 == max then
spd = '<td></td><td></td>'
@@ -294,6 +303,7 @@ local makeTable = function(web, hosts)
-- TODO - try to account for this better, this is just a quick hack.
end
week = '<td>&nbsp;' .. percentUp .. '% up</td><td>&nbsp;' .. percentUpdated .. '% updated</td>'
-- if ('100.00' ~= percentUp) or ('100.00' ~= percentUpdated) then inRR = "<font color='red'>&#x274c;</font>" end
end

web:write("<td>" .. ftp .. "&nbsp;</td><td>" .. http .. "&nbsp;</td><td>" .. https .. "&nbsp;</td><td>" .. rsync .. "&nbsp;</td><td>" .. 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 = "<font color='green'><b>&#x2705;</b></font>"
if nil ~= lc:find("<font color='") then
inRR = "<font color='red'>&#x274c;</font>"
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 = '[<a href="' .. adr .. k .. '_' .. i .. '">graphs</a>] &nbsp; '
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 = "<font color='green'><b>&#x2705;</b></font>"
if nil ~= lc:find("<font color='") then
inRR = "<font color='red'>&#x274c;</font>"
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 = '[<a href="' .. adr .. k .. '_' .. i .. '">graphs</a>] &nbsp; '
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 = "<font color='green'><b>&#x2705;</b></font>"
if nil ~= lc:find("<font color='") then
inRR = "<font color='red'>&#x274c;</font>"
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 = '[<a href="' .. adr .. k .. '_' .. l .. '">graphs</a>] &nbsp; '
if "" == log then n[l] = w else n[log .. inRR .. ' ' .. revDNS(hosts, k, l) .. ' ' .. lc] = w end
end
local log = '[<a href="' .. adr .. k .. '_' .. l .. '">graphs</a>] &nbsp; '
if "" == log then n[l] = w else n[log .. inRR .. ' ' .. revDNS(hosts, k, l) .. ' ' .. lc] = w end
end
end
end


Loading…
Cancel
Save