---
agent:
  instructions: "Search Greenbar's public pages and docs by keyword. A result has every word you give. Results are returned in Markdown."
  endpoint: "https://usegreenbar.com/.well-known/search?q={query}"
  method: "GET"
---

# Heartbeat monitors

> Check that a cron job or background task calls Greenbar on time.

## What it checks

A heartbeat monitor doesn't call your job. Your job calls Greenbar when it finishes. The monitor is up when a ping arrives within the interval plus the grace period, and down when that window passes with no ping.

Before the first ping, and still inside the first window, the check records nothing and says it is waiting. After that window with no ping, it is down. A ping from before a pause doesn't count after you resume: the window starts again.

## Add a monitor

1. Choose Add monitor, and choose Cron job / scheduled task.
2. Name the job, set how often it should run, and set Grace period (seconds).
3. Choose Create monitor. Copy the ping URL from the next screen. It is shown only once.
4. Call that URL with POST at the end of each successful run.

![The Add monitor form with Type set to Cron job / scheduled task, a name, Interval, Grace period in seconds and Create monitor.](https://usegreenbar.com/docs/screenshots/monitor-add-heartbeat-light.png?v=0193cc77c7b3)

*A heartbeat monitor. After you create it, the ping URL is shown once.*

**Fields on a heartbeat monitor**

| Field | What it does |
| --- | --- |
| Name | How the monitor is listed. |
| Interval | How often the job should ping: 30 seconds, 1 minute, 5 minutes, 10 minutes, 30 minutes and 1 hour, no faster than your plan allows. |
| Grace period (seconds) | Extra time after the interval before a missed ping is down. It starts at 5 minutes. Anything else is refused: `Grace period must be 0 to 86400 seconds`. |

- There is no Timeout (ms). Grace period (seconds) replaces it.
- A missed window opens an incident, and the next ping closes it.
- A new heartbeat starts hidden on the public status page. Under Monitors on status page, tick Visible to show it.
- On the monitor, Rotate ping URL stops the current URL at once and shows a new one once.

Related page: Status page settings and notices, where Visible is.

## The ping

The URL accepts POST only. A GET is refused with `use POST`, so a link preview can't count as a run. A successful ping answers `ok`.

- More than 60 pings in a minute answer `too many pings` and are not stored.
- A ping while the monitor is paused answers `paused` and is not stored.
- An unknown URL answers `not found`. The answer doesn't say which account it belongs to.

> **Warning.** Copy the ping URL when it is shown. If you lose it, rotate it. The old URL stops working at once.

## When a check fails

**Why a heartbeat fails, and what to change**

| What you see | Why | What to change |
| --- | --- | --- |
| Awaiting first ping | No ping yet, and the first window (the interval plus the grace) hasn't passed. Nothing is recorded. | Call the URL at the end of a run. |
| No ping yet, or no ping for a while | The window passed with no ping since checks started or since the last ping. | Check the job runs and that it calls the current URL. |
| `paused` | The monitor is paused, so the ping is not stored. | Resume the monitor. |
| `too many pings` | More than 60 pings arrived in a minute. | Ping once per run, not in a loop. |

Interval, timeout, pausing and plan limits are on the Shared settings page.
