summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xstatuspage/checks/hw.sh8
-rwxr-xr-xstatuspage/render.sh13
2 files changed, 13 insertions, 8 deletions
diff --git a/statuspage/checks/hw.sh b/statuspage/checks/hw.sh
index 259234d..54c4718 100755
--- a/statuspage/checks/hw.sh
+++ b/statuspage/checks/hw.sh
@@ -10,8 +10,12 @@ DIR=$(dirname "$0")
LOAD=$(sysctl -n vm.loadavg | tr -d '{}' | sed 's/^ *//;s/ *$//')
json_line "hardware" "load avg" "$LOAD" "ok"
-UPTIME=$(uptime | sed 's/.*up //;s/,.*load.*//')
-json_line "hardware" "uptime" "$UPTIME" "ok"
+BOOT=$(sysctl -n kern.boottime | sed -n 's/{ sec = \([0-9]*\).*/\1/p')
+SECS=$(($(date +%s) - BOOT))
+UP_D=$((SECS / 86400))
+UP_H=$(((SECS % 86400) / 3600))
+UP_M=$(((SECS % 3600) / 60))
+json_line "hardware" "uptime" "${UP_D}d ${UP_H}h ${UP_M}m" "ok"
MEM_FREE=$(sysctl -n vm.stats.vm.v_free_count)
MEM_PAGE=$(sysctl -n hw.pagesize)
diff --git a/statuspage/render.sh b/statuspage/render.sh
index a7f23c4..301b85d 100755
--- a/statuspage/render.sh
+++ b/statuspage/render.sh
@@ -120,19 +120,20 @@ END {
print "<title>" htmlesc(host) " status</title>"
print "<meta http-equiv=\"refresh\" content=\"30\">"
print "<style>"
- print "body { background:#111; color:#ddd; font-family: monospace; padding: 2em; }"
- print "h1 { color: #6ff; margin-bottom: 0; }"
- print "h2 { color: #9cf; border-bottom: 1px solid #333; padding-bottom: 4px; }"
+ print "body { background:#15111d; color:#e4dcee; font-family: monospace; padding: 2em; }"
+ print "h1 { color: #e0c3ff; margin-bottom: 0; display: inline-block; border-bottom: 2px solid #d9a441; padding-bottom: 6px; }"
+ print "h2 { color: #c084fc; border-bottom: 1px solid #3a2b4a; padding-bottom: 4px; }"
print ".cols { column-width: 380px; column-gap: 2.5em; }"
print ".section { break-inside: avoid; -webkit-column-break-inside: avoid; display: inline-block; width: 100%; vertical-align: top; margin-bottom: 1.5em; }"
print "table { border-collapse: collapse; width: 100%; }"
- print "td { padding: 6px 10px; border-bottom: 1px solid #222; }"
+ print "td { padding: 6px 10px; border-bottom: 1px solid #241c30; }"
print ".sq { display:inline-block; width:12px; height:12px; border-radius:2px; margin-right:6px; vertical-align:middle; }"
print ".green { background:#3c3; }"
print ".yellow { background:#cc3; }"
print ".red { background:#c33; }"
print ".gray { background:#666; }"
- print ".dim { color:#888; font-size: 0.85em; }"
+ print ".dim { color:#9c8aad; font-size: 0.85em; }"
+ print ".val { color:#d9a441; }"
print "</style>"
print "</head>"
print "<body>"
@@ -147,7 +148,7 @@ END {
print "<h2>" htmlesc(sect) "</h2>"
print "<table>"
for (j = 1; j <= count[sect]; j++) {
- valcell = (V[sect, j] == "") ? "" : "<td>" htmlesc(V[sect, j]) "</td>"
+ valcell = (V[sect, j] == "") ? "" : "<td class=\"val\">" htmlesc(V[sect, j]) "</td>"
print "<tr><td><span class=\"sq " sqclass(S[sect, j]) "\"></span>" htmlesc(L[sect, j]) "</td>" valcell "</tr>"
}
print "</table>"