Skip to content

Run reporting and alerts

Every host reconciles itself about every 20 minutes. A host that has fleet-notify tells you what happened:

Event Urgency Message
A run fails (check or apply) high (tag alert) “update FAILED”: the failing task and the start of its error. The same failure is repeated at most every 6 hours.
The first good run after a failure low (tag info) “update recovered”
An applied run that changed something low (tag info) How many changes, and in which roles
A config change was rolled back high (tag alert) What was wrong, and whether the service is running again

Messages are kept short for a phone; the full text is in the host’s logs. Other jobs use fleet-notify too, such as the exposure watch and updates. Every run’s full output is also kept on the host in last-run.log. A host without fleet-notify stays silent but still logs.

One host, the relay, holds a Home Assistant token. The others send to it over the tailnet (framework decision 31, role notify_relay). There is no second delivery path. If Home Assistant or the relay is down, fleet-notify exits non-zero, logs ALERT NOT SENT, keeps the alert and retries every five minutes. It drops one after 24 hours, or the oldest when more than 50 wait, and logs that. A retry can arrive twice, late or out of order; sigcli health shows alerts still waiting. The older Pushover setup does not retry. Watch the hosts, the relay and Home Assistant from something outside them.

  1. In Home Assistant, with Supernotify installed, make a non-admin user for alerts. Sign in as that user and create a long-lived access token (Profile, Security). A token probably cannot be limited to one action (VERIFY), so treat it as able to control things.
  2. scripts/notify.sh relay --relay <host>. It asks for Home Assistant’s address as that host reaches it and the token (hidden), checks the token and the Supernotify action, lists the people Home Assistant knows for you to pick, and offers one test alert. Then it tags the host, writes config/vars/group/util_notify_relay.yml and feat_notify.yml, and encrypts the secrets notify.relay and notify.client. If any step fails, nothing changes. Your machine must reach Home Assistant at the same address.
  3. scripts/preflight.sh --strict, commit on a branch, open a pull request, merge.
  4. After the relay host reconciles, on it: fleet-notify "test" "hello"; echo $?. It should reach the phone and print 0.
  5. Add the other senders: scripts/notify.sh relay --hosts <host>,<host>, then review and merge. Then test from one of them: this shows the tailnet lets it reach the relay.

Hosts with a container reconciler (Unraid, Alpine), macOS and Windows cannot send yet.

Set RECONCILE_NOTIFY_CHANGES=0 in /etc/fleet-reconcile.env on a host to drop the “N change(s) applied” notes. What a priority does (sound, which devices, quiet hours) is set in Supernotify.

scripts/notify.sh init --hosts <host> asks for a Pushover user key and application token, tags feat: [apprise] and stores apprise.notify; --replace rotates the keys. A host takes feat: [apprise] or feat: [notify], not both.