Heartbeat pings
The URL a cron job calls to say it ran, and what each answer means
Heartbeat monitors capability
A cron job monitor gives you one private URL. Your job calls it when it finishes, and the monitor goes down if the call does not arrive in time. Creating the monitor and choosing its schedule are covered in Cron job monitors. This page covers the requests themselves.
The URLs
https://acme.inbrief.sh/api/heartbeat/v1/ibhb_<token>
https://acme.inbrief.sh/api/heartbeat/v1/ibhb_<token>/start
https://acme.inbrief.sh/api/heartbeat/v1/ibhb_<token>/fail| Path | Tells InBrief |
|---|---|
/ibhb_<token> | The run finished. A basic job needs only this call. |
/start | A run has begun. It counts only when the monitor tracks start and finish signals, so that a run longer than its maximum runtime is reported. Otherwise it is accepted and ignored. Calling it again for a run that has already started changes nothing. |
/fail | The run ended badly. The monitor goes down straight away instead of at the deadline. |
Copy the URL from the dashboard. It is on your status page's own address, and the token is
ibhb_ followed by 64 hexadecimal characters. InBrief keeps only a hash of the token, so the
URL is shown once, when you create the monitor.
Treat the URL as a secret. It can only send signals for this one monitor and reads nothing, but anyone who has it can make a broken job look healthy. Rotating it from the monitor gives you a new URL. The old one keeps working for 5 minutes, or until the new one checks in for the first time, so you can update the job without missing a run.
Requests
Send GET, HEAD or POST. No header or key is needed: the token in the
path is the credential. The request body, the query string and any time you send are ignored, and the
signal is recorded at the moment InBrief receives it.
At the end of a crontab line:
0 3 * * * /usr/local/bin/backup.sh && curl -fsS -m 10 --retry 3 https://acme.inbrief.sh/api/heartbeat/v1/ibhb_<token>With start and failure signals:
URL=https://acme.inbrief.sh/api/heartbeat/v1/ibhb_<token>
curl -fsS -m 10 "$URL/start"
if /usr/local/bin/backup.sh; then
curl -fsS -m 10 --retry 3 "$URL"
else
curl -fsS -m 10 --retry 3 "$URL/fail"
fiResponses
| Status | Meaning |
|---|---|
204 | Accepted, with no body. The same answer comes back when the monitor is paused, when the status page is not taking new work, or when the account no longer has Heartbeat monitors. Nothing is recorded in those cases. |
404 | The token is malformed, unknown or revoked, or the monitor has been deleted. Check that you copied the whole URL, or rotate it. |
405 | The method is not GET, HEAD or
POST. |
429 | More than 30 signals for this URL in a minute, or more than 600 from one source address. |
503 | The receiver is briefly unavailable. Try again after a short wait. |
Every answer carries Cache-Control: no-store. A 204 means the request arrived,
not that the monitor is up, because a paused monitor answers the same way. The monitor in the dashboard
shows what was recorded.