MonSPHERE

Monitoring

Cron Job Monitoring

Your cron job or scheduled task pings us on its own schedule — we alert the moment a run goes missing.

Every other monitor type on this page works the same way: MonSPHERE reaches out to you on a schedule. Cron Job Monitoring (the heartbeat monitor type) inverts that — you reach out to us. There's no target URL, no region to pick, and it works for a job running behind a firewall or on a machine with no public IP at all, since nothing ever needs to connect in.

How it works

curl -X POST https://api.monsphere.com/api/v1/organizations/{orgId}/monitors \
  -H "X-Api-Key: msk_live_..." -H "Content-Type: application/json" \
  -d '{
    "name": "Nightly Backup",
    "type": "heartbeat",
    "intervalSeconds": 86400,
    "config": { "gracePeriodSeconds": 900 }
  }'

Creating the monitor returns a unique ping URL (/api/v1/ingest/heartbeat/{token}, shown once on the monitor's own detail page with a ready-to-copy curl line). Add a call to it at the end of your script or the last line of your cron job:

# crontab -e
0 2 * * * /opt/scripts/nightly-backup.sh && curl -fsS https://api.monsphere.com/api/v1/ingest/heartbeat/{token}

Both GET and POST work — a bare curl URL with no flags is enough, so the check-in never needs more than one extra shell token at the end of a line you already have.

Grace period

intervalSeconds is how often you expect a ping; gracePeriodSeconds (30s by default) is how much lateness is tolerated before it's treated as missed — a nightly job that usually finishes in 2 minutes but occasionally takes 12 shouldn't page anyone over that normal variance. The check only ever fails for silence, never for what the job itself did — Cron Job Monitoring has no concept of the job's own exit code or output, only whether it checked in on time.

How it runs

A heartbeat monitor is passive on MonSPHERE's side: nothing is ever scraped or probed. The worker only compares "time since last ping" against intervalSeconds + gracePeriodSeconds on its own schedule — the same internal scheduler Synthetic, WHOIS, API Transaction, and DNSBL monitors use, not Blackbox Exporter or Prometheus.