Heartbeat monitor
Know when a cron job or script stops running.
What it checks
Uptiva does not call anything. Your job calls Uptiva (a ping) when it runs. The monitor is down when no ping arrives within the expected period plus the grace period, or when your job reports a failure.
When to use it
For backups, cron jobs, queues and anything that runs on a schedule and has no URL to check.
Create it
- Open /app and click New monitor.
- Under What to monitor choose Heartbeat. Enter a Name.
- Under Schedule set Expected every: 1, 5, 15 or 30 minutes, or 1, 6, 12 or 24 hours.
- Set Grace period: 1, 5, 15 or 60 minutes. This is extra time before the monitor is called down.
- Under Alerts choose where alerts go, then click Create monitor.
- On the monitor page copy the address from Ping address and call it at the end of your job.
Ping your monitor
The Ping address card has the secret address and ready snippets. Anyone with the address can ping the monitor, so keep it private. Use GET, POST or HEAD:
# nightly at 02:00, ping only if the job succeeds
0 2 * * * /path/to/job.sh && curl -fsS -m 10 --retry 3 https://uptiva.linuxmaster.cloud/api/heartbeat/YOUR_TOKEN
# report a failure right away
curl -fsS -m 10 https://uptiva.linuxmaster.cloud/api/heartbeat/YOUR_TOKEN/failMore examples are in Heartbeat pings.
Check interval
There is no check interval. Expected every plus Grace period is the time allowed between pings, and the detection takes up to about 30 seconds after that window ends. A new monitor stays up until the first window passes without a ping.
What the monitor page shows
The Ping address card shows what is expected, the Last ping and Next ping due by (marked overdue when late), and a note when the last signal was a failure report. Heartbeats have no response time chart.
Alerts
You are alerted when the monitor goes down and when pings resume. A heartbeat alerts at the first missed window (the Alert after setting does not apply). Channels, quiet hours and escalation work as in Alerts.
Common problems and limits
- Down although the job ran. Check that the job really reaches the address, and that the grace period covers the longest run time.
- Too many pings. More than 60 pings per minute for one address are refused.
- A heartbeat counts toward your monitor limit.