Dead Man's Snitch
  1. Docs
  2. Monitoring

Cron Job Monitoring

Dead Man's Snitch makes it easy to monitor cron jobs and get alerted when they error or fail to run. The fastest way to get started is to use a command line HTTP client like curl to notify Dead Man's Snitch when your cron job runs. We recommend using Field Agent, our custom reporting agent, as it opens up new ways of debugging issues that help reduce the mean time to recovery (MTTR).

Quick Start with Curl

Let's say you have the below cron job that runs every 5 minutes.

5 * * * * /app/

To monitor this cron job add curl with the Snitch's unique URL after the job definition like so:

5 * * * * /app/; curl -s$?

Better Insights with Field Agent

Field Agent wraps your job, gathers extra data and metrics, and sends that data along with your check-in. This opens up new possibilities like accessing your job's error logs to get problems resolved faster. We recommend everyone use Field Agent, though some features will only be available on supporting plans.

Download and install Field Agent. Then, add it to your cron job line like below, using your Snitch's unique token. It's best to use the full path to the dms binary as it helps to avoid PATH issues.

5 * * * * /path/to/dms c2354d53d2 /app/