Glossary · Types of monitoring

What is heartbeat monitoring?

Cron job monitoring

Heartbeat monitoring, also called cron job monitoring, watches scheduled jobs and background processes by expecting a signal, a ping to a URL, each time they run, and alerts when a ping doesn’t arrive on time.

How it works and why it matters

Ordinary uptime checks ask a service from the outside. That doesn’t work for a backup script, a nightly import or a queue worker: they have no address to check, and when they stop, nothing visibly breaks until someone needs the data. A heartbeat turns the question around: the job reports in, and silence is the alert.

The job calls its own URL when it finishes, often with curl at the end of the crontab line. The monitor knows the schedule and allows a grace period for jobs whose run time varies. Pings at the start and on failure also catch jobs that hang, run too long, or run but fail.

Example

0 3 * * * /usr/local/bin/backup.sh && curl -fsS -m 10 --retry 3 https://YOUR-PING-URL

Runs every day at 03:00 and pings only when the backup succeeds (&&). If no ping has arrived by 03:00 plus the grace period, the job counts as down.

How Uptimecheck helps

Uptimecheck cron job monitors give each job a ping URL and expect it from every minute to every week, or on a crontab schedule in your time zone, with a grace period from 1 minute to 6 hours. Ping /start to measure the run time and get an alert when a run takes too long, call /fail or send the exit code to report a failure at once, and POST the job’s output to see it with the failure.

See Cron job monitoring

14-day free trial · No credit card required

Read more in the guides

Guides 6 min read

How to Monitor Cron Jobs with Heartbeats

Cron jobs fail silently. A heartbeat monitor alerts you when a scheduled job does not check in on time. How heartbeats work, how to add one to a crontab and which settings to choose.

Read

Questions

What is a grace period?

Extra time after the expected run before a missing ping counts as a failure. Set it a little longer than the usual variation in the job’s start and run time.

Should the ping go at the start or the end of a job?

At the end, after success, so a job that fails or hangs doesn’t ping. A start ping as well lets the monitor measure the run time and catch jobs that never finish.

Can heartbeats watch things other than cron jobs?

Yes: anything that runs on a rhythm, such as queue workers, backups, data syncs, scheduled tasks on Windows and CI jobs, can ping a URL when it completes.

Downtime is obsolete.

Set up your first monitor in under a minute, or look around the live demo first.

14-day free trial · No credit card required