# Heartbeat Monitoring

> An alert that fires when a job stops checking in. It catches silent failures.

**Field:** Infrastructure  
**Category:** Monitoring & Observability  
**Also known as:** Dead Man's Switch, Cron Job Monitoring, Heartbeat Check, Check-In Monitoring

## Think of it like

Think of it like a friend who calls you if you do not text them each night.

## Definition

Heartbeat monitoring waits for a job to check in on time, and raises an alert when it goes quiet. The job sends a small ping each time it finishes, such as after a nightly backup. The monitor knows when the next ping is due. If none arrives, something stopped, even though nothing reported an error. It catches the failures that make no noise at all.

## Example

Lucy's backup script pings a heartbeat address after each nightly run. One night the disk is full and the script never starts, and the missing ping wakes her up.

## Example code

```bash
0 2 * * * /usr/local/bin/backup.sh && curl -fsS https://hc.example.com/ping/backup
```

The ping is sent only if the backup worked. No ping by morning means an alert.

## Why it matters

A job that never runs writes no error. Without a heartbeat, a broken backup can stay hidden for months.

## Common mistake

Sending the ping at the start of the job. Then a job that crashes halfway still looks fine, so ping at the end.

## Three principles

- **Expect a ping.** Each run checks in when it is done.
- **Silence is the alarm.** No ping means something stopped.
- **For quiet jobs.** Backups, timed jobs and queues.

## Related terms

- [Monitoring](https://learn.benibix.com/term/infrastructure/monitoring)
- [Alerting](https://learn.benibix.com/term/infrastructure/alerting)
- [Uptime Monitoring](https://learn.benibix.com/term/infrastructure/uptime-monitoring)
- [Backup](https://learn.benibix.com/term/infrastructure/backup)
- [Data Restore](https://learn.benibix.com/term/infrastructure/data-restore)
- [Cron](https://learn.benibix.com/term/infrastructure/cron)

## Told apart from

- [Uptime Monitoring vs Heartbeat Monitoring](https://learn.benibix.com/compare/uptime-monitoring-vs-heartbeat-monitoring): People think an uptime check will notice a failed nightly job, and it will not. An uptime check knocks on a service and waits for an answer. A heartbeat monitor waits for the job to knock on its door. A backup that never ran has no door to knock on, so only the missing heartbeat shows it.

![Four ways to watch an app, around one app box. Top left, a robot script visits it on a timer. Top right, real users' phones and laptops send timings back. Bottom left, an agent inside the app times each step. Bottom right, a nightly job sends a ping to a heartbeat monitor.](https://learn.benibix.com/diagrams/inf4-monitoring-views.svg)

---

Source: https://learn.benibix.com/term/infrastructure/heartbeat-monitoring
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
