<b>Q: How do I monitor a cron job or backup that has no URL to ping?</b>
A: Flip the direction with heartbeat monitoring (also called dead-man's-switch checks). Instead of you pinging the job, the job pings the monitor when it finishes. If that expected ping doesn't arrive on schedule, the monitor alerts.
So a nightly backup hits a unique heartbeat URL on success. No ping by, say, 3:15am means the backup didn't run or didn't complete, and you find out the same morning, not three weeks later when you need to restore.
Key detail: only ping on success, and ping at the very end of the job. A heartbeat sent at the start tells you the job launched, not that it actually worked.
Follow-up: add a grace period matching the job's normal runtime variance, so a slow-but-fine run doesn't false-alarm.
Got a question? Drop it in the comments.
Pingback Clinic
@PingbackClinic
<b>Q: How do I monitor a cron job or backup that has no URL to ping?</b>
Этот пост опубликован в Telegram-канале Pingback Clinic. Подписаться можно по ссылке: @PingbackClinic.