BlogMonitoring

Cron Monitoring 101: What a Heartbeat Is and Why You Need One

Monitoring·6 min read·By the TorixPulse Team

Uptime checks are great for things you can reach from the outside. But what about the backup that runs at 2am, or the queue worker that's supposed to be running? You can't ping those — and when they quietly stop, you often don't find out until you need the thing they were supposed to produce.

Enter the heartbeat

A heartbeat monitor (a "dead man's switch") inverts the model. Instead of the monitor checking your service, your job checks in with the monitor. You get a unique ping URL and add one line to your job so it calls that URL when it finishes successfully. If a ping doesn't arrive within a window you define, the monitor alerts you — because that silence means the job didn't run.

Two settings that matter

  • Period — how often you expect a ping (e.g. every 24 hours for a nightly backup).
  • Grace — extra slack before alerting, so a job that runs a little late doesn't trigger a false alarm.

Pinging from a cron job

crontab
# Run a backup, then ping only if it succeeded
0 2 * * *  /usr/local/bin/backup.sh && curl -fsS https://api-pulse.torixstack.com/ping/YOUR_TOKEN

Because the ping is chained with &&, a failed backup sends no ping — and you get alerted.

Monitor it with TorixPulseCreate a heartbeat and get alerted when a job silently fails.
Start free