PR 4: backup Healthchecks.io dead-man's-switch monitoring
Created by: jedmund
Summary
Final PR in the backup series. Adds Healthchecks.io as the dead-man's-switch for nightly borgmatic runs. If 02:00 passes without a successful run plus a grace window, Healthchecks.io alerts via whatever channel you've configured on its side (email, ntfy, Slack, etc.).
This PR is stacked on PR 3 (jedmund/backup-ui). When PRs 2 and 3 merge, GitHub auto-rebases this onto main.
What it does
- Adds borgmatic's native
healthchecks:config block. Default pings onfinishandfailstates withsend_logs: trueso the dashboard shows the full run output. -
borg_healthchecks_urllives ingroup_vars/backup/vault.yml. Passed through to the container asHEALTHCHECKS_PING_URL, referenced fromborgmatic.yamlvia{credential env HEALTHCHECKS_PING_URL}. - README walks through Healthchecks.io project setup (account, check, schedule, grace, notification channels).
What's not in this PR
- Netdata Prometheus scrape of borgmatic metrics. Earlier research was ambiguous about whether the borgmatic-collective image actually exposes a
/metricsendpoint. Deferred until verified; immediate value of dead-man's-switch alerting is higher than trend graphs anyway.
Setup checklist (after merge)
- Create Healthchecks.io account (free tier is plenty for one check)
- Create check: name
nuc-mini borgmatic, cron schedule0 2 * * *, grace1 hour - Copy the ping URL (
https://hc-ping.com/<uuid>) - Add to vault:
ansible-vault edit group_vars/backup/vault.yml # add: borg_healthchecks_url: "https://hc-ping.com/<uuid>" make deploy-backup- Trigger a manual borgmatic run, confirm the check turns green in Healthchecks.io dashboard
Commits
backup: ping Healthchecks.io on every borgmatic run
Test plan
-
After deploy, manual borgmatic run causes the Healthchecks.io check to go green (success ping received) -
Dashboard shows borgmatic output in the run history (confirms send_logs: trueworking) -
Intentionally break a backup (e.g. wrong passphrase) and verify Healthchecks.io receives a fail ping -
Skip a run (stop the container before 02:00) and verify Healthchecks.io alerts after grace period