Monitor Windows scheduled tasks

Windows scheduled task monitoring is easy with Cronitor. By updating your scheduled action to run using CronitorCLI exec you'll gain visibility with a web dashboard and receive alerts if any problems occur, including:

  • The task does not run when expected
  • The task exited with an error
  • The task runs for longer than expected

Creating a scheduled task monitor

Monitoring scheduled tasks can be completed in just a few minutes, no coding required.

  1. First, determine the frequency of the scheduled task. The schedule is displayed in the interface. In this example, the task runs every 2 minutes. For tasks with complicated schedules or multiple schedules, please contact support to discuss implementation options.
  2. From your dashboard, click the button to create a new monitor and select Heartbeat
  3. Add a "Complete endpoint not pinged in 2 minutes" rule. Optionally, add a "Ran for longer than" rule to identify tasks that run longer than expected.
  4. Optionally add notification methods like Email, SMS, Slack, Hipchat, PagerDuty, etc
  5. Give the monitor a descriptive name like Offsite Backup and add optional tags or notes
  6. Save the monitor and you will be given a unique code.

Your new monitor is created in a paused state; monitoring will not begin until the first ping is received.

Integrating your scheduled task monitor

On your server, download the CronitorCLI application. We recommend moving the executable to %SystemDrive%\Program Files\ for system-wide use. From the Task Scheduler, update the scheduled task action you are monitoring to invoke CronitorCLI:

  1. Right click the desired scheduled task, select Properties, select Actions, select the first action listed, click "Edit".
  2. Turn the command being invoked into an argument to cronitor exec. In this example you see that the C:\app\bin\collect-stats command is now being passed as an argument to CronitorCLI. the first argument after exec, d3x0c1, is the unique code for this monitor, copied from the Cronitor dashboard.

    Program/script Arguments
    Before integration C:\app\bin\collect-stats PRODUCTION
    After integration C:\Program Files\cronitor.exe exec d3x0c1 C:\app\bin\collect-stats PRODUCTION

    Before you are running C:\app\bin\collect-stats directly:


    After integration you are using CronitorCLI to run the command:
  3. If your scheduled task has multiple actions listed, repeat this step for each action.
  4. If possible, run your task manually from the Task Scheduler to ensure that it works properly. You should see the details from the run on your Cronitor dashboard within a few seconds.

Integrating without installing software

Cronitor integration can be accomplished without installing CronitorCLI. To do this, move your current command and arguments to a .bat file, use curl or similar to send pings to your monitor's unique /run endpoint before your command /complete after it exits. For more details, see "Integration without an API client" in the Integration Guide.