UptimeRobot heartbeat alternative for cron job monitoring

A heartbeat monitor works the opposite way from an uptime check: your job pings the monitor, and you get an alert when the ping stops. If you use UptimeRobot heartbeat monitors and want to compare or move, switching is mostly a matter of changing one URL.

Updated

Short answer

Create a Heartbeat monitor in UptimeIO, copy its URL, and replace the UptimeRobot heartbeat URL in your cron entry or script. Set the interval to how often the job runs and add a grace period for slow runs. Heartbeat monitors are on every UptimeIO plan, including Free.

Try a heartbeat monitor free

How an UptimeRobot heartbeat monitor works

UptimeRobot describes heartbeat monitoring as working the opposite way to other monitor types. It does not check your server. Your server or job sends regular HTTP requests to the heartbeat URL, and if UptimeRobot does not receive a request within the monitor's interval, the monitor goes down.

Its help center suggests sending the request from cron with wget or curl, or from Windows Task Scheduler. The same pattern works with any heartbeat service, so the job itself rarely changes.

What to copy when you switch

Write down these settings from each UptimeRobot heartbeat monitor before you change anything:

UptimeRobot settingUptimeIO equivalent
Monitor intervalExpected Interval, from 1 minute to 24 hours
Heartbeat URLHeartbeat Endpoint, generated when you create the monitor
Alert contactsDestinations assigned in the monitor's Notifications section

UptimeIO also has a Grace Period setting, the lateness you tolerate on top of the interval. Because the ping is sent when the job ends, size it to your slowest normal run. A backup that takes 10 to 20 minutes needs about 30.

Switch the ping URL

Create the UptimeIO monitor first, then replace the URL in your job. Send the ping only when the job succeeds by joining it with &&, so a failed run sends nothing.

crontab: run at 02:00, ping on successShell
0 2 * * * /opt/scripts/backup.sh && curl -fsS -m 10 --retry 3 https://heartbeat.uptimeio.com/heartbeat/YOUR_HEARTBEAT_TOKEN > /dev/null

The heartbeat URL works like a password. Keep it out of public repositories and shared logs.

Heartbeat monitoring on UptimeIO

  1. Create a monitor and choose the Heartbeat type.
  2. Set the Expected Interval and the Grace Period.
  3. Copy the heartbeat URL into your job as shown above.
  4. Choose where alerts go: email, Slack, Telegram, Pushover or a webhook.
  • Plans: heartbeat monitors are on every plan, including Free. The shortest interval is 5 minutes on Free and 1 minute on Pro and Scale.
  • Incidents: an incident opens when a ping is late, and resolves after 3 on-time pings in a row.
  • Alerts: Slack, Telegram and webhook alerts are included on Free.

The cron job guides cover the usual reasons a scheduled job stops, from the environment cron runs in to schedulers that skip runs. Pair a heartbeat with a fix for the underlying cause, so the same job does not fail twice.

Questions

How does a heartbeat monitor work?
Your job sends a request to a unique URL each time it runs. The monitor alerts you when a request does not arrive on time, so a job that crashed or never started is caught too.
How do I move a heartbeat monitor from UptimeRobot?
Create a Heartbeat monitor in UptimeIO with the same interval, copy its URL, and replace the UptimeRobot URL in your cron entry or script. Run both for a few days, then pause the old one.
Is heartbeat monitoring free on UptimeIO?
Yes. Heartbeat and cron monitoring is on every plan, including Free. The shortest interval is 5 minutes on Free and 1 minute on Pro and Scale.
What grace period should I use?
Enough to cover your slowest normal run, since the ping is sent when the job ends. A job that takes 10 to 20 minutes needs about 30.

Related

Start monitoring in a few minutes

Start monitoring free

Free plan · 50 monitors · No credit card required