Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stacks/sensitive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,8 @@ everything:
NBA, NFL, MLB and NHL scores
from ESPN; the full ticker list with charts; and the TSP L 2060 fund with a
year's sparkline.
- **Homelab** (`homelab.yml`): a headline strip, the Estate panel, uptime
badges, hosts, every console by category, the household monitor and
- **Homelab** (`homelab.yml`): a headline strip, the Estate panel, what
fired in the last 24 hours, uptime badges, hosts, every console by category, the household monitor and
Saruman's VMs.
- **Network & Storage** (`network.yml`): traffic per VLAN and at the WAN, the
last speed test, pools and SMART, and the UPS.
Expand Down
47 changes: 41 additions & 6 deletions stacks/sensitive/glance/pages/homelab.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Homelab: the estate at a glance (ADR-0100) — the headline
# strip, alerts, uptime, hosts, guests and every console. Network & Storage
# and Maintenance have the detail. Status here comes from Prometheus, never
# from a check this container makes, except the Household monitor: trinity
# cannot reach VLANs 30 and 40, so a direct check of a console there would
# always read down.
# Homelab: the estate at a glance (ADR-0100) — the headline strip, alerts
# now and over the last day, uptime, hosts, guests and every console. Network
# & Storage and Maintenance have the detail. Status here comes from
# Prometheus, never from a check this container makes, except the Household
# monitor: trinity cannot reach VLANs 30 and 40, so a direct check of a
# console there would always read down.
- name: Homelab
width: wide
head-widgets:
Expand Down Expand Up @@ -361,6 +361,41 @@
<p class="size-h6 margin-top-15">CHECKED <span {{ now | toRelativeTime }}></span> AGO</p>
{{ end }}

# What fired in the last 24 hours, firing still or not: the warnings
# and criticals, which are what Alertmanager sends to ntfy. Read back
# from Prometheus's own ALERTS series with the reader token, so it
# needs no ntfy credential. The value is seconds since each was last
# firing; the one-minute subquery step can miss an alert shorter than
# a minute.
- type: custom-api
title: Last 24 hours
cache: 5m
<<: *prometheus
parameters:
query: >-
time() - max by (alertname, instance, severity) (last_over_time(timestamp(
ALERTS{alertstate="firing", severity=~"warning|critical"})[24h:1m]))
template: |
{{ $rows := sortByFloat "value.1" "asc" (.JSON.Array "data.result") }}
{{ if ne .Response.StatusCode 200 }}
<p class="color-negative">Prometheus answered {{ .Response.StatusCode }}</p>
{{ else if not $rows }}
<p class="color-positive">Nothing fired.</p>
{{ else }}
<ul class="list list-gap-10 collapsible-container" data-collapse-after="6">
{{ range $rows }}
{{ $age := .Float "value.1" }}
<li class="flex justify-between">
<span class="{{ if eq (.String "metric.severity") "critical" }}color-negative{{ end }}">
{{ .String "metric.alertname" }}{{ with .String "metric.instance" }} · {{ . }}{{ end }}</span>
{{ if lt $age 120.0 }}<span class="size-h6 color-negative">firing</span>
{{ else if lt $age 3600.0 }}<span class="size-h6">{{ printf "%.0f" (div $age 60.0) }}m ago</span>
{{ else }}<span class="size-h6">{{ printf "%.0f" (div $age 3600.0) }}h ago</span>{{ end }}
</li>
{{ end }}
</ul>
{{ end }}

# Uptime-Kuma-style badges from the blackbox probes Prometheus already
# runs every 30 seconds: now, and the share of probes that passed over
# 24 hours and 7 days. A service probed twice (by name and by address)
Expand Down
4 changes: 3 additions & 1 deletion stacks/sensitive/glance/pages/maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,12 @@
# New releases of the software this estate pins: the services, not the
# lint and build tools. Dependabot opens the PR; this is the heads-up.
# Once per six hours per repository, with the no-permission token so
# the 32 requests do not spend the house's anonymous 60 an hour.
# the 32 requests do not spend the house's anonymous 60 an hour. The
# newest 25 of them, six until expanded; Glance's default is 10.
- type: releases
cache: 6h
token: ${GLANCE_GITHUB_TOKEN}
limit: 25
show-source-icon: false
collapse-after: 6
repositories:
Expand Down