Skip to content

feat(alerts): alert when a known pool is not imported - #137

Merged
gnacho merged 1 commit into
mainfrom
feat/136-pool-missing-alert
Sep 21, 2026
Merged

gnacho merged 1 commit into
mainfrom
feat/136-pool-missing-alert

Conversation

@gnacho

@gnacho gnacho commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Closes #136.

What

EvaluatePools only evaluated pools returned by the collector. When a pool fails to auto-import (e.g. after an unclean shutdown), it vanishes from zpool list and no alert was raised, even though every dataset and container on it stays down.

How

  • New known_pools table (migration v23): the alerter persists every pool it sees, with first/last seen timestamps.
  • After each collection (light and full), a known pool absent for more than EASYZFS_POOL_MISSING_AFTER seconds (default 300) raises a critical pool_missing alert. Fresh installs (empty table) never alert, so "never seen" is distinguished from "seen before and now missing".
  • New kind pool_missing in the push/email/channel i18n catalog (ES/EN) and in the notification preference types.
  • New GET /api/pools/missing endpoint; the dashboard shows a persistent critical banner listing the missing pools with a shortcut to Pools.

Detection is strictly read-only: the app never attempts to import.

Test plan

  • 5 new tests in internal/alerts/pool_missing_test.go (fresh install, missing pool alerts, grace window, re-import without re-alert, API contract). Full suite green.
  • Validated live on two hosts: seeded a stale pool entry, alert + banner appeared; removed it, state back to normal.

@gnacho
gnacho merged commit 00b2e27 into main Sep 21, 2026
3 checks passed
@gnacho
gnacho deleted the feat/136-pool-missing-alert branch September 21, 2026 18:30
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.

Alert when a known pool is missing (not imported)

1 participant