Cron job monitoring
Heartbeat monitoring for cron jobs, WP-Cron and background tasks
A scheduled job that stops running does not crash, does not log an error and does not show on an uptime check — it simply does nothing, for weeks. MySentry gives every job a heartbeat: one tiny request when it finishes. If the heartbeats stop past a threshold you set, or the very first one never arrives, you get an alert.
The failure nothing else reports
Backups, invoice runs, reminder emails, feed imports, cache warming, WordPress’s own scheduled events: all of them fail silently. A server reboot without the cron daemon, a rotated password, a renamed script, a deployment that forgot to schedule the job, a provider that quietly dropped the trailing slash from a URL — the job stops, and the only symptom is a customer asking, weeks later, why their report never came.
How a heartbeat works
Step 1
The job reports in
At the end of each run it sends one POST with its name, whether it succeeded and, optionally, how many records it processed. One line of curl is enough.Step 2
The monitor registers itself
The first heartbeat creates the monitor automatically with a 26-hour silence threshold. Tune the threshold per job in the panel — 15 minutes for a queue worker, 26 hours for a nightly run.Step 3
Silence becomes an alert
When the last heartbeat is older than the threshold, MySentry sends one alert per day for that job — on Slack and to your phone — with the time of the last pulse.
Jobs that never start
Monitors created by the first heartbeat share a blind spot: a job that was never scheduled never beats, so nothing waits for it. MySentry lets you register an expected monitor before the job exists — name and threshold — and counts the silence from that moment. If the first heartbeat has not arrived by the deadline you receive a distinct “never started” alert pointing at the likely cause. This exact failure — jobs deployed but never run, silently, for days — is why the feature exists.
One line in any language
# at the end of the job
curl -s -X POST https://www.mysentry.co.uk/api/ingest/heartbeat \
-H "Authorization: Bearer <your reporting key>" \
-H "Content-Type: application/json" \
-d '{"monitor":"nightly-backup","ok":true,"processed":1240}'ok:false records a failed run; threshold_minutes lets the job set its own silence threshold. Monitor names are letters, digits, dots and dashes. Details in the documentation.
WordPress: WP-Cron watched out of the box
The WordPress plugin sends a heartbeat every hour (or twice daily, or daily) from WordPress’s own scheduler, so a site whose WP-Cron has stopped — scheduled posts not publishing, WooCommerce emails queued forever, backups not running — is reported within the threshold you choose, typically three hours.
Cron monitoring questions
What are cron job (heartbeat) monitors?
A heartbeat is a tiny request your scheduled job sends to MySentry each time it finishes: ‘nightly-backup ran, 1,240 records processed’. If the heartbeats stop — the job crashed, the server rebooted without it, someone changed a password — MySentry notices the silence and alerts you. The first heartbeat registers the monitor automatically; the default silence threshold is 26 hours and can be tuned per job.
What happens if a scheduled job never starts at all?
That is the failure most monitoring misses: a job that was deployed but never scheduled sends no heartbeat, so a monitor that waits for the first one would wait forever. In MySentry you can register an expected monitor before the job exists; if the first heartbeat has not arrived by the deadline you get a distinct ‘never started’ alert.
My site uses a system cron instead of WP-Cron. Does the heartbeat still work?
Yes. The heartbeat is a scheduled WordPress event, so it runs whenever WordPress’s scheduled events run — whether that is triggered by visitors or by a system cron calling wp-cron.php. Set the silence threshold to match your schedule.
How do I send a heartbeat from any cron job?
Add one line at the end of the job: a POST to the heartbeat endpoint with the monitor name and whether it succeeded — a curl command is all it takes. The first heartbeat creates the monitor; the panel then lets you set how long a silence is acceptable.
Give every scheduled job a heartbeat
MySentry is in early access. Leave your email and you’ll get an invitation with founder pricing.
No spam, one email, unsubscribe any time.