Docs menu

Dead man’s switch

Most monitoring tells you when something happens. A dead man’s switch tells you when something stops happening — the nightly backup that silently quit, the cron job that never ran, the server that dropped off the network.

The watched thing checks in on a schedule with a single GET. If check-ins stop for longer than the switch’s interval (plus a grace period), Pinglet fires an urgent alert to the topic of your choice. When check-ins resume, you get a recovery notice.

1. Create a switch

In your namespace dashboard at app.pinglet.co.uk, open Switches and create one. Choose:

  • the check-in interval — how often the watched thing should ping,
  • the grace period — slack before the switch fires,
  • the notify topic — where the alert goes (subscribe to it in the app).

You get an unguessable check-in URL:

https://app.pinglet.co.uk/v1/ping/<token>

The token is the capability — no API key needed to check in.

2. Check in on a schedule

Have the watched thing hit the URL each time it does its job. For a cron job, append the ping to the command:

# crontab: nightly backup at 02:00, check in on success
0 2 * * * /usr/local/bin/backup.sh && curl -fsS https://app.pinglet.co.uk/v1/ping/<token>

The && matters: the ping only fires when the job succeeds, so a failing backup stops the check-ins and trips the switch.

A healthy check-in returns 200 ok. An unknown token returns 404 — a typo’d URL fails loudly instead of the switch silently going dark.

3. What fires

  • Down: once the interval + grace passes with no check-in, the switch flips to down and publishes an urgent, error-level alert to the notify topic — it breaks through Do Not Disturb like any urgent message.
  • Recovery: the next successful check-in publishes a success-level “back to healthy” notice.

Each transition alerts once — a switch that stays down doesn’t re-alert every sweep, and a recovery fires at most once even under concurrent check-ins.

Switch alerts are system messages: they deliver even if your namespace has hit its monthly notification cap — being over quota shouldn’t hide the news that your backups stopped.

Ideas

  • Backups — ping after a successful pg_dump/restic run.
  • Cron & scheduled tasks — anything in a crontab or task scheduler.
  • Hosts — a once-a-minute ping from a box that must stay up.
  • People & processes — anything that should happen on a rhythm and quietly might not.