diff --git a/stacks/sensitive/README.md b/stacks/sensitive/README.md index 667ebb85..0e3fe41b 100644 --- a/stacks/sensitive/README.md +++ b/stacks/sensitive/README.md @@ -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. diff --git a/stacks/sensitive/glance/pages/homelab.yml b/stacks/sensitive/glance/pages/homelab.yml index e465e99b..0e32b256 100644 --- a/stacks/sensitive/glance/pages/homelab.yml +++ b/stacks/sensitive/glance/pages/homelab.yml @@ -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: @@ -361,6 +361,41 @@

CHECKED AGO

{{ 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 }} +

Prometheus answered {{ .Response.StatusCode }}

+ {{ else if not $rows }} +

Nothing fired.

+ {{ else }} + + {{ 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) diff --git a/stacks/sensitive/glance/pages/maintenance.yml b/stacks/sensitive/glance/pages/maintenance.yml index d2f6da44..860a6d8d 100644 --- a/stacks/sensitive/glance/pages/maintenance.yml +++ b/stacks/sensitive/glance/pages/maintenance.yml @@ -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: