aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apt-panopticon-report-email-web.lua
diff options
context:
space:
mode:
Diffstat (limited to 'apt-panopticon-report-email-web.lua')
-rwxr-xr-xapt-panopticon-report-email-web.lua21
1 files changed, 10 insertions, 11 deletions
diff --git a/apt-panopticon-report-email-web.lua b/apt-panopticon-report-email-web.lua
index dd8cff6..622b0be 100755
--- a/apt-panopticon-report-email-web.lua
+++ b/apt-panopticon-report-email-web.lua
@@ -89,6 +89,7 @@ local status = function(hosts, host, results, typ)
89 89
90 if to then 90 if to then
91 result = "TIMEOUT" 91 result = "TIMEOUT"
92 hosts[host].passed = false;
92 if not s then result = result .. "*" end 93 if not s then result = result .. "*" end
93 if APT.html then 94 if APT.html then
94 if s then 95 if s then
@@ -104,6 +105,7 @@ local status = function(hosts, host, results, typ)
104 end 105 end
105 elseif 0 < e then 106 elseif 0 < e then
106 result = "FAILED" 107 result = "FAILED"
108 hosts[host].passed = false;
107 if not s then result = result .. "*" end 109 if not s then result = result .. "*" end
108 if APT.html then 110 if APT.html then
109 if s then 111 if s then
@@ -206,13 +208,15 @@ local DNSrrTest = function(hosts, k)
206 if nil ~= hosts[APT.options.roundRobin.value].IPs[APT.options.roundRobinCname.value] then 208 if nil ~= hosts[APT.options.roundRobin.value].IPs[APT.options.roundRobinCname.value] then
207 if nil ~= hosts[APT.options.roundRobin.value].IPs[APT.options.roundRobinCname.value][i] then 209 if nil ~= hosts[APT.options.roundRobin.value].IPs[APT.options.roundRobinCname.value][i] then
208 local log = logCount(APT.options.roundRobin.value, i) 210 local log = logCount(APT.options.roundRobin.value, i)
211 local inRR = "<font color='green'><b>&#x2705;</b></font>"
212 if nil ~= log:find("<font color='") then inRR = "<font color='red'>&#x274c;</font>" end
209 if "" ~= log then 213 if "" ~= log then
210 if "" == dns then dns = " " else dns = dns .. space end 214 if "" == dns then dns = " " else dns = dns .. space end
211 dns = dns .. logCount(APT.options.roundRobin.value, i) 215 dns = dns .. inRR .. logCount(APT.options.roundRobin.value, i)
212 else 216 else
213 if "" == dns then dns = " " else dns = dns .. space end 217 if "" == dns then dns = " " else dns = dns .. space end
214 if APT.html then i = "<font color='maroon'><b>" .. i .. "</b></font>" end 218 if APT.html then i = "<font color='maroon'><b>" .. i .. "</b></font>" end
215 dns = dns .. i 219 dns = dns .. inRR .. i
216 end 220 end
217 end 221 end
218 end 222 end
@@ -246,6 +250,7 @@ local makeTable = function(web, hosts)
246 if nil == v.Active then active = 'nil' else active = v.Active end 250 if nil == v.Active then active = 'nil' else active = v.Active end
247 web:write(" <tr style='background-color:dimgrey'><th>" .. k .. "</th> ") 251 web:write(" <tr style='background-color:dimgrey'><th>" .. k .. "</th> ")
248 end 252 end
253 hosts[k].passed = true;
249 local inRR = "<font color='green'><b>&#x2705;</b></font>" 254 local inRR = "<font color='green'><b>&#x2705;</b></font>"
250 local ftp = "<font color='grey'><b>skip</b></font>" 255 local ftp = "<font color='grey'><b>skip</b></font>"
251 local http = status(hosts, k, results, "http") 256 local http = status(hosts, k, results, "http")
@@ -264,14 +269,7 @@ local makeTable = function(web, hosts)
264 local week = '<td>&nbsp;</td><td>&nbsp;</td>' 269 local week = '<td>&nbsp;</td><td>&nbsp;</td>'
265 if nil == rate then rate = '' end 270 if nil == rate then rate = '' end
266 271
267 -- DNS-RR test. 272 if not hosts[k].passed then inRR = "<font color='red'>&#x274c;</font>" end
268-- if nil == http: find('OK') then inRR = "<font color='red'>&#x274c;</font>" end
269-- if nil == https: find('OK') then inRR = "<font color='red'>&#x274c;</font>" end
270-- if nil == protocol: find('OK') then inRR = "<font color='red'>&#x274c;</font>" end
271-- if nil == redirects: find('OK') then inRR = "<font color='red'>&#x274c;</font>" end
272-- if nil == sanity: find('OK') then inRR = "<font color='red'>&#x274c;</font>" end
273-- if nil == integrity: find('OK') then inRR = "<font color='red'>&#x274c;</font>" end
274-- if nil == updated: find('OK') then inRR = "<font color='red'>&#x274c;</font>" end
275 273
276 if (APT.options.roundRobin.value ~= k) and (nil ~= hosts[APT.options.roundRobin.value]) then 274 if (APT.options.roundRobin.value ~= k) and (nil ~= hosts[APT.options.roundRobin.value]) then
277 if 0 == max then 275 if 0 == max then
@@ -323,8 +321,9 @@ local makeTable = function(web, hosts)
323 week = '<td>&nbsp;' .. percentUp .. '% up</td><td>&nbsp;' .. percentUpdated .. '% updated</td>' 321 week = '<td>&nbsp;' .. percentUp .. '% up</td><td>&nbsp;' .. percentUpdated .. '% updated</td>'
324-- if ('100.00' ~= percentUp) or ('100.00' ~= percentUpdated) then inRR = "<font color='red'>&#x274c;</font>" end 322-- if ('100.00' ~= percentUp) or ('100.00' ~= percentUpdated) then inRR = "<font color='red'>&#x274c;</font>" end
325 end 323 end
324 if "yes" ~= hosts[k].DNSRR then inRR = " &nbsp; &nbsp; " end
326 325
327 web:write("<td>" .. ftp .. "&nbsp;</td><td>" .. http .. "&nbsp;</td><td>" .. https .. "&nbsp;</td><td>" .. rsync .. "&nbsp;</td><td>" .. dns .. 326 web:write("<td>" .. ftp .. "&nbsp;</td><td>" .. http .. "&nbsp;</td><td>" .. https .. "&nbsp;</td><td>" .. rsync .. "&nbsp;</td><td>" .. inRR .. " " .. dns ..
328 "&nbsp;</td><td>" .. protocol .. "&nbsp;</td><td>" .. redirects .. "&nbsp;</td><td>" .. sanity .. "&nbsp;</td><td>" .. integrity .. "&nbsp;</td>" .. '<td>' .. rate .. 327 "&nbsp;</td><td>" .. protocol .. "&nbsp;</td><td>" .. redirects .. "&nbsp;</td><td>" .. sanity .. "&nbsp;</td><td>" .. integrity .. "&nbsp;</td>" .. '<td>' .. rate ..
329 '</td><td>' .. updated .. '</td>&nbsp;' .. spd .. "&nbsp;" .. week .."&nbsp;</tr>\n") 328 '</td><td>' .. updated .. '</td>&nbsp;' .. spd .. "&nbsp;" .. week .."&nbsp;</tr>\n")
330 if "" ~= active then 329 if "" ~= active then