Uptime Kuma push heartbeat for checking snapshot freshness

Hi,

I wanted to share a small tool I built on top of restic: restic-monitor.

It runs periodically (e.g. via systemd timer), calls restic snapshots on each configured repository, checks whether the most recent snapshot is newer than a configurable max_age, and sends an up/down heartbeat to an Uptime Kuma push monitor. If a backup job stops running, the heartbeat stops and you get alerted.

One feature that might be of interest to this community: a fast mode (RESTIC_MONITOR_FAST=true) that, for S3-backed repositories, skips calling restic entirely and instead lists objects under the snapshots/ key prefix directly via the S3 API. The object’s last-modified time is used as a proxy for the snapshot time. This means the monitoring credentials need only s3:GetObject + s3:ListBucket — no repository password required on the monitoring host, which is useful when the monitor runs on a separate machine.

A NixOS module is included in the flake. Happy to hear feedback or answer questions.

Blog post: restic-monitor: Never Miss a Failed Backup | stv0g's weblog
Repo: stv0g/restic-monitor: Check age of snapshots in a Restic repository - Codeberg.org