Use script-based threshold items to monitor specific values and trigger alerts when certain conditions are met. By linking a script to a threshold item, you can track a wide range of metrics and get notified whenever those metrics reach predefined thresholds.
How script-based threshold monitoring works
Script-based threshold items give you the flexibility to monitor exactly what matters in your environment, beyond predefined or custom metrics. By attaching your a monitoring script to a threshold item, you can decide which values to track and define the conditions that will trigger alerts.
Where they apply: Script-based threshold items support Windows PowerShell (.ps1) and Shell (.sh) scripts (macOS and Linux) that don’t contain variables.
What they do: The script runs automatically on the target device every polling cycle (approximately 1.5 to 2 minutes), outputs a value, and checks it against the operator and threshold you set (e.g., greater than, less than, equal to).
When alerts trigger: If the script’s output meets the threshold condition during a polling cycle, an alert is raised — and any attached auto-healing scripts will run. Note that because polling happens approximately every 2 minutes, there can be a short delay between the condition being reached and the alert/action being triggered.
Automation options: You can attach up to 3 auto-healing scripts to a script-based threshold item, allowing issues detected by the monitoring script to be automatically remediated.
Output visibility: The results of the monitoring script are recorded in the alert details when an alert is received. Script-based threshold items are intended for alerting and remediation — the script output is not saved as a per-device field. If you want the output visible under each device's Agent Console > Custom fields tab (and available for reporting), create a script-based Agent custom field separately using the same script. (Available on Enterprise and SuperPower plans.)
Execution time limit: Script-based threshold items are designed to run quickly and return results promptly. Each script has a maximum execution time of 10 seconds. If a script exceeds this limit, it will be automatically terminated. This behavior is intentional and ensures the monitoring package, which runs approximately every 90 seconds, can complete all processes before the next cycle begins. Scripts that require longer execution times (more than 10 seconds) should be configured under IT Automation profiles instead of script-based threshold items.
Create script-based threshold item
Add PowerShell (.ps1) and Shell (.sh) scripts — that don't contain variables — to script-based threshold items.
To create a script-based threshold item:
1. Go to Admin > Monitoring and automation > Thresholds.
The Threshold profiles page appears.
2. Select an existing profile (or create a new one).
The threshold profile appears.
3. Click New item.
The Threshold item window appears.
4. From the Script-based tab, enter the alert title. Then click Select under Monitoring script.
The Select script window appears.
5. From your My scripts tab, select the script.
Note: You can also create a script from scratch or search the Shared Script Library for community-submitted scripts.
The monitoring script is added to the threshold item.
6. Complete the threshold item:
- Select the alert severity.
- Select the value type and operator. Then set the value.
- Set the time period.
- Note: An alert is generated after each time period interval (with a delay of up to 2 minutes).
- Select up to 3 auto-healing scripts. Learn more
7. Click Add.
The script-based threshold item is added to the threshold profile.
8. Click Save.
The threshold profile is updated to include the script-based item. When a threshold condition is met, the script output will be recorded within the generated alert.