Run an Automated Task when a check fails
You can set up Automated Tasks to run when a check fails when you add or edit a task or a check. For example, you can have an automated task automatically deal with the cause of a check failure such as running a Clean All Temp Files Task when the Disk Space Check fails.
Automated Tasks are supported for Windows, Mac (from Agent 2.3.0), and Linux (from Agent 2).
The selected Automated Task only runs when a passing check fails and creates an entry in the Outages tab. The Automated Task does not continually run when a check is in the failed state—the check must first pass, then fail again before the Automated Task is triggered.
Tasks tab
To set up an Automated task to run when a check fails when you add or edit a task:
- On the All Devices view North-pane, select the device.
- You can add or edit a task:
Choice Action Add a task In the South-pane Tasks tab, click Add Automated Task. The Add Automated Task dialog opens.
Edit a task In the South-pane Tasks tab, right-click the target Check and select Edit Check. The Edit Automated Task dialog opens.
- Select the script from the expandable sections that list the available scripts and click Next.
Only scripts that are uploaded for Automated Tasks and are associated with the device's Operating System are displayed.
- Enter a name for the task
and enter any script parameters required for the selected Automated Task and select Next.
The following example shows the script parameters for the Active Directory Users Query task.
- In the Select Frequency Method drop-down menu, select On Check Failure.
- Select which Check failure will trigger the task to run in When Check Fails, and select or enter additional settings if they are available in With These Settings... and select Next.
- Set maximum permitted execution time for the script (optional).
- Select Finish to save and apply.
Checks tab
To set up an Automated task to run when a check fails when you add or edit a check:
- On the All Devices view North-pane, select the device.
- You can add or edit a check:
Choice Action Add a check - In the South-pane Checks tab, click Add Check.
- Choose the Check from Add 247 Check or Add DSC Check.
Edit a check In the South-pane Checks tab, right-click the target Check and select Edit Check. - Configure the check as required.
- Enable Assign a Task after creating the Check and select OK.
The Add Automated Task dialog opens.
- Select the Automated Task script and select Next to configure.
- Enter any required Command Line parameters or Script parameters and select Next.
- Set maximum permitted execution time for the script (optional).
- Select Finish to save and apply.
View check and Automated Task association
All Automated Tasks associated with the check appear in the Checks tab in the Assigned Tasks column. Click the Assigned Tasks link to open the Tasks tab and view information about the Task.
If multiple Automated Tasks are associated with a check, the Assigned Tasks column reports the number of configured Tasks.
The Tasks tab includes a list of associated checks in the Assigned Check column. Click the Assigned Check link to open the Checks tab and view information about the check.
Any changes to the Automated Task are completed on the Tasks tab.