Skip to content

feat(observability): watch Saruman's thin pools and its Proxmox firewall (#538, #576) - #639

Merged
Gerrrt merged 1 commit into
mainfrom
gerrrt/todays-completable-issues-9c0e75
Sep 23, 2026
Merged

Gerrrt merged 1 commit into
mainfrom
gerrrt/todays-completable-issues-9c0e75

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Sep 23, 2026

Copy link
Copy Markdown
Owner

What

There are two gaps on Saruman, and both follow the pattern guest-state already uses.

Collector Reads Timer Rules
collect-thin-pool-state.sh lvs --select 'lv_attr=~^t' 10 min ThinPoolNearlyFull (warning: 80% data or 60% metadata), ThinPoolWillFillIn24h (critical: predict_linear over 6h, once the pool is >50% used), ThinPoolStateStale
collect-pve-firewall-state.sh pve-firewall status, plus active rules in cluster.fw and host.fw 5 min PveFirewallDisabled (critical, 10m), PveFirewallStateStale

Choices worth reviewing:

  • A failed command writes nothing. A broken lvs is never reported as zero pools, and an unreadable status is never reported as the firewall being off. This follows the lesson from guest-state.
  • Staleness uses node_textfile_mtime_seconds, not presence. A textfile series is still served after its collector stops, so only the file's age shows the timer died (the same reasoning as SmartStateStale).
  • Data and metadata get a space label via label_replace. The two series share a label set, so a bare or would give the alert duplicate label sets whenever both crossed at once. The first rule test covers exactly that case.
  • enabled/stopped counts as off. That is the state pve-firewall stop leaves behind.
  • Unit hardening matches homelab-guest-state.service. Mount-namespace directives are left off because /etc/pve is a FUSE mount, and an unreadable host.fw would read as zero rules.

Verified

  • Both collectors were run with --print on Saruman on 2026-09-22 (read-only). Results: large_data 7.87% data / 0.42% metadata, pve/data 1.55% / 0.29%, firewall enabled/running, host.fw 4 rules, cluster.fw 0 rules. The thin-pool fixture is that lvs output.
  • promtool test rules passes for all test files (promtool 3.14.0, matching the pinned image), and promtool check metrics passes on both collectors' output.
  • self-tests.sh passes for both new suites (10 and 5 fixtures).
  • shellcheck, yamllint, markdownlint, editorconfig-checker and check_docs.py all pass.
  • One local failure is unrelated: backup-offsite.sh's "DEST under /tmp" fixture fails where /tmp is a tmpfs. That's true on Saruman, not on the CI runner.

Not done here: needs the host

These are why the PR says Refs rather than Closes. Both issues close once the steps above are done.

Refs #538, #576

🤖 Generated with Claude Code

…all (#538, #576)

A thin pool is not a filesystem, so HostDiskCritical and
HostDiskWillFillIn24h could not see pve/data or large_data. A pool that
fills turns every guest on it read-only at once. Separately, #566 turned
Saruman's firewall on and nothing checked that it stayed on.

Two agent collectors are added beside guest-state, each with --print,
--self-test, a unit, a timer and a row in install-agent-collectors.sh:

- collect-thin-pool-state.sh reads lvs every 10 min.
  ThinPoolNearlyFull warns at 80% data or 60% metadata.
  ThinPoolWillFillIn24h is critical: predict_linear over 6h, once the
  pool is half used. Data and metadata are told apart by a `space` label.
- collect-pve-firewall-state.sh reads pve-firewall status every 5 min
  and counts the active rules in cluster.fw and host.fw.
  PveFirewallDisabled is critical after 10 min.

A failed command writes nothing, so a failure is never reported as zero
pools or as the firewall being off. ThinPoolStateStale and
PveFirewallStateStale fire on the file's mtime rather than on presence,
because a textfile series is still served after its collector stops.

Both collectors were run with --print on Saruman on 2026-09-22 and read
7.87% / 1.55% data on the two pools, enabled/running, and four host.fw
rules. That output is the thin-pool fixture. Five rules and ten promtool
cases are added; counted claims and the runbooks are updated.

Refs #538, #576

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.

1 participant