Heartbeat monitoring reverses the usual direction of a check. Instead of a monitor requesting your service, your job sends a request ("ping") to the monitor after each successful run. If no ping arrives within the expected window plus a grace period, an alert fires. It is also called dead man's switch or cron monitoring.
Why it matters
Scheduled jobs such as backups, invoice runs and queue workers have no URL to probe, and they fail silently: the cron entry is deleted, the server is rebuilt, or the script exits early. A missing ping reveals the absence of something that should have happened.
Example
A nightly backup that pings only on success:
0 2 * * * /usr/local/bin/backup.sh && curl -fsS -m 10 --retry 3 -o /dev/null "https://your-monitor.example/ping/YOUR-UNIQUE-TOKEN"
Using && means a failed backup sends no ping. Set the monitor's expected period to 24 hours and a grace time of 15 to 30 minutes for run-time variation.
Common mistakes
- Pinging at the start of the script, so a crash midway still looks healthy.
- Using
;instead of&&, which pings even when the job fails. - Setting no grace period, which alerts on every slightly late run.
- Sharing one heartbeat among several jobs, so one healthy job hides another's failure.
Related
- Synthetic monitoring
- Health check
- Uptime
- Guide: Cron job heartbeat monitoring guide
- Tool: Cron monitoring
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.