Documentation

Everything you need to set up checks and alerts.

Quick start

  1. Sign up: enter your email and open the link we send.
  2. Click “New check”, give it a name and the job’s schedule, for example 0 3 * * *.
  3. Copy the ping URL and add it to the end of your job:
# crontab: nightly backup at 3:00, pings only when it succeeds
0 3 * * * /opt/backup.sh && curl -fsS -m 10 --retry 5 https://ping.heartcron.com/<uuid>

If the ping doesn’t arrive on time, Heartcron alerts you on the channels you connected: email, Telegram, Slack, Discord or a webhook.

Ping URLs

Every check has two URLs that work the same way:

GET, POST and HEAD all work. A ping to a paused check resumes it.

Signals

URLMeaning
/<uuid>The job succeeded
/<uuid>/startThe job started. If success doesn’t follow within the grace period, the job is treated as hung
/<uuid>/failThe job failed: the alert goes out right away
/<uuid>/<code>An exit code from 0 to 255: 0 is success, anything else is a failure
/<uuid>/logJust a log entry; the status doesn’t change

Sending /start before success also gives you the job’s duration in the event log.

Job output

Send up to 100 KB of output in a POST body. It is saved with the event and you can read it in the dashboard:

/opt/backup.sh 2>&1 | tail -c 100000 | curl -fsS -m 10 --data-binary @- https://ping.heartcron.com/<uuid>/$?

Don’t send passwords or keys in the body: the output is stored and shown in the dashboard.

Schedules and grace periods

Statuses

NewNo pings yet
UpThe last ping arrived on time
DownA ping was missed, the job reported a failure, or the site isn’t responding
PausedThe check isn’t watching and sends no alerts

You get one alert when a check goes down and one when it recovers, not one on every run.

Examples

Bash with an exit code

#!/bin/sh
URL=https://ping.heartcron.com/<uuid>
curl -fsS -m 10 "$URL/start"
/opt/report.sh
curl -fsS -m 10 --retry 5 "$URL/$?"

GitHub Actions

- name: Ping Heartcron
  if: always()
  run: curl -fsS -m 10 --retry 5 https://ping.heartcron.com/<uuid>/${{ job.status == 'success' && '0' || 'fail' }}

Kubernetes CronJob

command: ["/bin/sh", "-c", "/app/job && wget -q -T 10 -O /dev/null https://ping.heartcron.com/<uuid>"]

Python

import urllib.request
urllib.request.urlopen("https://ping.heartcron.com/<uuid>", timeout=10)

Each check’s page has ready-made snippets with its URL for crontab, Bash, Python, Node.js, PowerShell, GitHub Actions and Kubernetes.

Site checks

For sites and servers, Heartcron sends the requests itself, from several regions:

A check goes down only when it fails twice in a row in at least two regions, so one flaky network route won’t wake you at night. Checks run every 5 minutes on the Free plan and as often as every 30 seconds on Business.

Alerts

Connect channels on the project’s Integrations tab: email, Telegram, Slack, Discord and webhooks. Webhooks receive a JSON event with an X-Heartcron-Signature header (HMAC-SHA256 of the body with your secret). “Send test alert” checks a channel right away.

Responses and limits

ResponseWhen
200 OKThe ping was recorded
404No such check: double-check the URL
429More than 5 pings per second for one check

Questions or ideas: hello@heartcron.com.