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

2 Likes

Hi,

I’ve built nearly the same tool, probably you’ll find it useful

Cheers

Tom

Hi Tom,

I actually found your dashboard before starting my implementation. However, I still decided to implement my own solution as I did not like the complexity of deploying a Java-based application and also exposing more applications / ports on my monitoring machine.

A nice advantage of the push-type monitor is that it does not need any externally reachable ports.

Thanks the feedback in the replies. I have released v1.2.0 with the following improvements:

  • Option to run restic-monitor as a HTTP server for pull-type health checking

  • Fast mode: Support for local and sftp repos

  • Standard mode: Support for filtering snapshots by hosts, paths and tags

Question

Is this complementary to a mechanism like resticprofile - which drives backups from specifications in a yaml file?

Yes, its not driving backups, but rather helps to check that they are made regularly.

Yes, that makes sense (simple and clean). My prior requirement was to create a dashboard for the department of QA and compliance so that they have a quick look for the actual status and more important the status of the retention policy.

And hey, Java apps aren’t more complex than Go apps in our days (especially if you use docker) :grinning_face:

Cheers

1 Like

Version v1.3.0 now also supports defining more checks which can be performed:

  • List of files which must be present in latest snapshot
  • Minimum size
  • Minimum number of files or blobs
  • Minimum compression ratio

Pretty cool! Thanks for sharing :slight_smile: