Heartbeat (dead-man's-switch) monitoring

Monitoring & Alerts·Intermediate·Updated May 31, 2026

Heartbeat monitoring (a dead-man's switch) is for jobs CronJobPro does not run for you, such as a backup script on your own server or a step in your CI pipeline. Instead of CronJobPro calling your job, your job calls CronJobPro on every successful run. If an expected ping never arrives within the time you allow, CronJobPro alerts you.

When to use a heartbeat monitor

Use a heartbeat monitor when the work happens somewhere CronJobPro cannot reach, or when you only care that something finished, not how it was triggered. Common examples are nightly database dumps, log rotation, cache warmers, and scheduled CI tasks. If you instead want CronJobPro to make the HTTP request itself on a schedule, create a regular cron job rather than a heartbeat monitor.

Create a monitor and get the ping URL

  1. 1

    Add a heartbeat monitor

    In the dashboard, create a new heartbeat monitor and give it a clear name that matches the job it watches.

  2. 2

    Set the expected period

    Tell CronJobPro how often a successful ping should arrive, for example once every 24 hours for a nightly backup.

  3. 3

    Set a grace window

    Add a grace period on top of the expected period so a job that runs a little late does not trigger a false alarm.

  4. 4

    Copy your ping URL

    Each monitor gets a unique URL in the form https://cronjobpro.com/ping/<token>. Copy it; you will call it from your script.

Ping on success, failure, and exit code

Call the base URL after the job finishes successfully. To report a failure explicitly, append /fail. To report the exact exit status of your command, append /exitcode/<n>, where a 0 is treated as success and any other value as a failure.

EndpointMeaning
https://cronjobpro.com/ping/<token>Success: the job completed
https://cronjobpro.com/ping/<token>/failFailure: the job ran but did not succeed
https://cronjobpro.com/ping/<token>/exitcode/<n>Report the command exit code (0 = success)
#!/usr/bin/env bash
set -uo pipefail

PING_URL="https://cronjobpro.com/ping/<token>"

# Run your real work
/usr/local/bin/backup.sh
CODE=$?

# Report the exact exit code (0 = success, anything else = failure)
curl -fsS -m 10 --retry 3 "$PING_URL/exitcode/$CODE" >/dev/null

# Simple alternative: ping success only if the command succeeded
# /usr/local/bin/backup.sh && curl -fsS -m 10 "$PING_URL"
# On failure, signal it explicitly:
# /usr/local/bin/backup.sh || curl -fsS -m 10 "$PING_URL/fail"

Send the success ping only after the work actually finishes, never at the start. Pinging too early defeats the dead-man's switch, because a job that crashes mid-run would still look healthy.

What triggers an alert

CronJobPro watches each monitor continuously: the watchdog checks every 30 seconds, with a short warm-up after a monitor is created. If no successful ping arrives within the expected period plus the grace window, or if you send a /fail or a non-zero /exitcode, you receive an alert through your configured channels (email, Slack, Discord, webhook, PagerDuty, Opsgenie, Microsoft Teams, and the in-app bell). You also get a recovery notification once successful pings resume.

Configure where alerts go under Settings, Notifications, and review the broader monitoring and reliability options in the docs.

Set up notification channels

More resources

Related articles

Was this helpful?

If you still have questions, our team is happy to help.

Contact support
Heartbeat (dead-man's-switch) monitoring — Help | CronJobPro