Skip to content
Mementropy
Lab NotesHomelab notebookField note

Auditing the homelab with a pod and Prometheus instead of cron

Six checks published as metrics; overall_pass=1.

By Ryan Hammang

I want one place that tells me whether the platform is in the state I think it’s in.

My first thought was a scheduled CI job. I chose a small auditor pod that Prometheus scrapes instead, because:

  1. The CI runner is locked out of the cluster API, Infisical, Proxmox and the NAS on purpose. An audit job would need all of those.
  2. An hourly job is about 8,760 runs a year cluttering the Actions page, and it stops if Gitea or the runner is down.
  3. Prometheus already stores numbers over time and can alert on them.

The auditor runs on the Dell cluster, with read-only access to the x1 cluster. It checks six things:

  1. All 14 Gitea repos mirror to GitHub with no sync errors.
  2. All 89 secrets are covered by the cloud sync.
  3. All 5 InfisicalSecret resources are Ready.
  4. All 13 Argo CD Applications are Synced and Healthy.
  5. Nightly backups are under 30 hours old, and test restores match table counts for all 5 databases.
  6. All 5 Postgres StatefulSets are Ready.

Each check is a metric. Detail goes to the pod’s JSON logs. Today overall_pass is 1.