Heartbeats (cron and job monitoring)
← All articlesHeartbeats (cron and job monitoring)
A heartbeat check watches a scheduled job from the inside: the job calls a URL when it runs, and an alert opens when the calls stop.
- Open Heartbeats and create a heartbeat. Choose the site it belongs to, a name, how often the job runs (5 minutes, 15 minutes, 1 hour, 1 day or 1 week) and a grace period (1, 5 or 15 minutes, or 1 hour).
- Copy the ping URL shown after saving. It has the form
https://app.uptimevanguard.com/ping/<token>on the hosted service. - Call the URL at the end of each successful run.
GET,POSTandHEADare accepted. For example, in a crontab:
0 * * * * /usr/local/bin/backup.sh && curl --fail --silent --show-error --max-time 10 "$HEARTBEAT_URL" > /dev/null
- Run the job once and check that the heartbeat shows a recent ping.
When an alert opens
A detector runs every minute. When no ping has arrived within the interval plus the grace period, counted from the last ping or from creation, the heartbeat fails and an incident opens on its site. The site's channels receive a site down alert. The next ping closes the incident and sends a site recovered alert. Heartbeats do not use multi-region confirmation, because the job itself reports in.
Maintenance windows and snoozes on the site apply to heartbeat incidents as well.
Security
The token in the URL is the only credential: anyone who knows it can report a successful run. Keep it out of public logs and repositories. An unknown token returns 404.
If a heartbeat never arrives, check that the job host can make outbound HTTPS requests and that the command only runs after the job succeeds.