Windows Scheduled Task monitoring is easy with Cronitor. Our web dashboard provides you with better visibility into your tasks, and we'll send instant alerts if any goes wrong, including:
There are two ways to create Scheduled Task monitors with Cronitor.
Use the web dashboard to create individual monitors.
Our web dashboard is an easy to use interface, and creating new monitors can be done quickly by anyone with a Cronitor account.
Integrate with our Monitor API to programatically create monitors.
For more advanced use cases, such as adding Cronitor to provisioning or deployment scripts, we offer an easy to use REST API as well as open-source API clients for many popular languages.
First, determine the schedule that your task is running on. This can be found in the Task Scheduler interface. In this example, the task runs every 2 minutes.
You're done! Your monitor will be assigned a unique ping url and be placed in a pending state. Monitoring will begin when the first ping is received.
First, determine the schedule that your task is running on. This can be found in the Task Scheduler interface. In this example, the task runs every 2 minutes.
Add a not_completed_in 2 minutes
rule. Optionally, add a ran_longer_than
rule to identify tasks that run longer than expected.
Use cURL
or one of our open-source API clients to make a POST
request.
curl -X POST https://cronitor.io/api/monitors -u <API-KEY>: -d '{ "key": "offsite-backup", "type": "job", "platform": "windows", "schedule": "0 */3 * * 1-5", "assertions": ['metric.duration < 5 minutes'] }' -H "Content-Type: application/json"
Tip: Complete documentation for our Monitor API can be found here.
You're done! Your monitor will be assigned a unique ping url and be placed in a pending state. Monitoring will begin when the first ping is received.
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:
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 key 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 |
C:\app\bin\collect-stats
directly: Tip: Cronitor integration can be accomplished without installing CronitorCLI. To do this, move your current command and arguments to a .bat file, and using curl
or similar to ping to your monitor's unique /run
endpoint before your task runs, and ping /complete
after it exits.
Cronitor can send alerts via many different channels, including: Email, Slack, PagerDuty, Microsoft Teams, SMS, webhooks and more.
Notification lists are configurable sets of channels that are attached to your monitors. When a monitor fails or recovers, an alert will be sent to every channel/recipient on the attached list. You can create or modify a list from the Notification Lists section of your settings page.
In the monitor's edit form locate the Alert Receipients panel. You may choose to add a notification list or add channels/recipients directly (or both).
Specify alert recipients adding a notify
array to your monitor JSON as shown below. Notification lists are attached using the template
key. For complete list of options see our API docs.
curl -X POST https://cronitor.io/api/monitors \ -u <API-KEY>: \ -H "Content-Type: application/json" -d '{ "key": "Database Backup", "type": "job", "schedule": "0 */3 * * 1-5", "notify": ['devops-emergency'] }'
Tip: When your Cronitor account is created a list named "Default" will automatically be created, and your email address will be added to it. When no list is specified the default list will be used.
By default Cronitor will alert you every time we detect a problem. If you can tolerate a few failures, and do not wish be alerted each time, you can set the failure tolerance threshold of your monitor. You will be sent an alert when the number of consecutive failures exceededs the threshold.
In the monitor's edit form locate the Alert Preferences panel and select Failure Tolerance. Choose "Only send an alert if there is a persistent problem". Set the failure tolerance as desired.
Specify failure tolerance by adding the key tolerated_failures
to your monitor's JSON object. The value is the threhold number.
curl -X POST https://cronitor.io/api/monitors \ -u <API-KEY>: \ -H "Content-Type: application/json" -d '{ "key": "Database Backup", "type": "job", "schedule": "0 */3 * * 1-5", "tolerated_failures": 5 }'