Cron Monitoring

Ever setup a cron job that worked so well that you set it up and forgot about it only to find out it stopped working after awhile and you had no idea?

Central Logging can alert you when your cron or background jobs fail or stop reporting in, so there are no more silent failures.

Central Logging Cron Monitoring

To monitor any job send an HTTP request with API key and job name. Ex:

curl http://localhost:8080/p/your-uuid-apikey/name-of-your-job?state=complete

The API key needs to be created one-time in Central Logging before hand but the job name can be created on the fly. Once you create your API key you can sprinkle these at the end of all your cron jobs and just change the job name to describe the cron.

If you know your job failed you can set the failure state:

curl http://localhost:8080/p/your-uuid-apikey/name-of-your-job?state=fail

If you want to measure how long your job takes or detect when it never completes send a run state before you start your job and a complete when it completes.

States:

  • start
  • complete
  • fail

Simple Cron monitor example:

* 0 * * * /important-job.py && curl https://your-central-logging-instance.com/p/<API-KEY>/test-job?state=complete

You can even include metadata

curl https://your-central-logging-instance.com/p/<API-KEY>/test-job?state=complete \
    &status_code=0 \
    &message=Backup+Complete \
    &metric=duration:418.44 \
    &metric=count:3319

💌 Get notified on new features and updates

Only sent when a new version is released. Nothing else.