Skip to content

feat(alerts): warn on heimdall's updates, units, heat and silence, and keep its bootloader current - #1726

Merged
Gerrrt merged 5 commits into
mainfrom
gerrrt/heimdall-bootloader-and-alerts
Nov 24, 2026
Merged

Gerrrt merged 5 commits into
mainfrom
gerrrt/heimdall-bootloader-and-alerts

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Nov 24, 2026

Copy link
Copy Markdown
Owner

What changed

heimdall, the office wall Pi, gets four non-paging warnings, and its build runbook gets a step that keeps its bootloader up to date. The runbook's §2 now:

  • writes the bootloader at each boot, using a drop-in that removes the -s flag from rpi-eeprom-update;
  • purges rpi-connect-lite;
  • runs apt autoremove --purge;
  • tells unattended-upgrades to remove unused dependencies from then on.

The new warnings are DisplayUpdatesStalled, DisplayUnitFailed, DisplayHot and DisplayDown. They're in host.rules.yaml and select role="display". Each has a firing test and a quiet one.

The new §2 steps are not yet applied on the Pi, because they need the operator's sudo password.

Why

A read-only re-check of heimdall on 2026-11-24 confirmed all twelve of the 2026-11-23 audit's fixes. A new audit would still find two things:

  • The bootloader is from June 2025. The rpi-eeprom package went to 28.38 unattended, carrying the October 2026 bootloader. The boot-time service runs with -s, which writes only when the chip is older than Raspberry Pi's floor for critical fixes. The 09:10 boot logged "Skipping automatic bootloader upgrade". §2 said the nightly reboot made upgraded firmware run, which was not true of the bootloader.
  • No rule read what heimdall exports. InstanceDown excludes it by design, and the nightly HostRebooted is info, which is never sent. apt_upgrades_pending, node_systemd_unit_state and the SoC temperature were scraped, and nothing watched them.

The changelog entry has the details. node.yaml's comment no longer claims the scrape covers the throttle state, which node_exporter does not report.

Blast radius

  • The rules: four new warnings that select only role="display", which is only heimdall. DisplayUpdatesStalled routes to the security receiver and the other three to default. None is critical, so none pages. If an expression is wrong, the worst case is a missing or spurious warning about the wall Pi.

  • The runbook, once applied: the Pi will write a new bootloader at its next boot. On a Pi 5 that is a flashrom write that the script verifies. If the write fails, recovery.bin is left on the card to retry at the next boot. §9 says how to undo it.

  • Rule counts: the counts in prose are bumped: 182 → 186 Prometheus rules, 210 → 214 in all, 188 → 192 on the Rules page.

  • No change to network segmentation or firewall rules

  • No new port published to a VLAN that could not already reach the service

  • No credential added outside secrets/*.sops.yaml

Verification

  • On the Pi, over SSH, read-only:

    • rpi-eeprom-update printed BOOTLOADER: update available, CURRENT 2025-06-13, LATEST 2026-10-30.
    • The service's journal at the 09:10 boot logged Skipping automatic bootloader upgrade. current 1749807566 >= min 1746713597.
    • On a Pi 5 the script writes the chip with flashrom and then verifies it (/usr/bin/rpi-eeprom-update, lines 286–320).
  • Against prometheus:

    • heimdall's apt_upgrades_pending, node_systemd_unit_state and node_hwmon_temp_celsius series exist with the labels the tests use.
    • The SoC is chip="thermal_thermal_zone0". Its 7-day maximum was 57.85 °C.
    • In the last day, ALERTS{instance="heimdall"} held only HostRebooted, which is info.
  • Checks:

    • promtool check rules rules/host.rules.yaml: SUCCESS: 67 rules found.
    • promtool test rules tests/host.test.yaml: SUCCESS.
    • python3 scripts/check_rule_tests.py: rule tests OK.
    • python3 scripts/check_docs.py: docs OK — 186 Prometheus + 28 Loki rules.
  • ./scripts/lint.sh: yamllint, ruff, shellcheck and actionlint pass.

    • ansible-lint fails, and fails the same way on main: a local uv/--pip-args problem that has nothing to do with this change.
    • Skipped because this Mac has no Docker daemon: markdownlint-cli2, zizmor, packer, tofu and editorconfig-checker.
    • The full make validate and amtool route test were not run.
  • make validate passes

  • Deployed to the lab and confirmed working

  • Docs updated (docs/, service README, or docs/roadmap.md)

🤖 Generated with Claude Code

…d keep its bootloader current

A read-only re-check of heimdall on 2026-11-24 found its bootloader still
at June 2025's: rpi-eeprom-update.service runs with -s, which writes only
below Raspberry Pi's critical floor. build-heimdall.md §2 now drops the -s
with a drop-in, purges rpi-connect-lite, autoremoves, and has
unattended-upgrades remove unused dependencies.

It also found nothing reading what heimdall exports. Four warnings on
role="display" now do: DisplayUpdatesStalled, DisplayUnitFailed,
DisplayHot and DisplayDown, each with a firing and a quiet test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gerrrt
Gerrrt marked this pull request as ready for review November 24, 2026 21:11
Copilot AI balanced review requested due to automatic review settings November 24, 2026 21:11
@Gerrrt
Gerrrt enabled auto-merge (squash) November 24, 2026 21:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The alert’s three-day pending timer can reset during short scrape gaps, preventing it from ever firing with daily interruptions, and the existing fixture does not cover this failure case.

1 open issue
What changed in this PR

Adds non-paging monitoring for heimdall, the office wall display, and documents how to keep its bootloader current alongside unattended package updates.

Changes:

  • Adds four display warnings for stalled updates, failed units, high temperature, and prolonged scrape failure, with firing and quiet tests.
  • Extends the build runbook with bootloader updates, package cleanup, and rollback instructions; these steps remain unapplied.
  • Updates alert counts and documentation, including correcting the scrape comment about throttle-state reporting.
File Description
stacks/​observability/​README.md Updates the Prometheus alert count.
stacks/​observability/​prometheus/​tests/​host.test.yaml Adds firing and quiet cases for display warnings.
stacks/​observability/​prometheus/​targets/​node.yaml Clarifies display monitoring in comments only.
stacks/​observability/​prometheus/​rules/​host.rules.yaml Adds four display-specific warning rules.
README.md Updates overall and Prometheus alert totals.
docs/​security.md Updates the alert total.
docs/​runbooks/​deploy-stack.md Updates the expected Rules page count.
docs/​runbooks/​build-heimdall.md Documents bootloader maintenance, cleanup, warnings, and rollback.
docs/​observability.md Describes display coverage and updates rule totals.
docs/​changelog.md Records the re-check, changes, and pending operator steps.

Review effort: Balanced

Gerrrt and others added 4 commits November 24, 2026 13:19
A failed scrape at the 04:30 reboot marks apt_upgrades_pending stale, which
reset the three-day timer every night, so the alert could never fire. Read
max_over_time over 15 minutes instead, and test it with a stale sample
each day.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oader-and-alerts

# Conflicts:
#	docs/changelog.md
…oader-and-alerts

# Conflicts:
#	docs/changelog.md
…oader-and-alerts

# Conflicts:
#	README.md
#	docs/observability.md
#	docs/runbooks/deploy-stack.md
#	docs/security.md
#	stacks/observability/README.md
@Gerrrt
Gerrrt merged commit b7cdc1d into main Nov 24, 2026
9 checks passed
@Gerrrt
Gerrrt deleted the gerrrt/heimdall-bootloader-and-alerts branch November 24, 2026 22:13
Gerrrt added a commit that referenced this pull request Nov 24, 2026
…ten by flashrom (#1730)

Applying #1726's §2 on heimdall found no /dev/spidev*, so
rpi-eeprom-update staged pieeprom.upd and recovery.bin for the next boot
instead of writing the chip. The runbook says so now, and a changelog
entry corrects #1726's and records the apply.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants