Use threshold profiles in combination with scripts to monitor specific values and trigger alerts when certain conditions are met. For example, you can monitor battery health by defining the health metric with your script and setting a threshold to receive alerts when the battery health drops below a certain percentage. How you define and measure battery health is up to you — you're writing the script!
This article describes:
Create a script-based threshold item
Note:
- Script-based threshold items are available for Windows devices only.
- Script-based threshold items support PowerShell (.ps1) files only and do not support scripts with variables.
To create a script-based threshold item:
1. From Admin (on the sidebar), click Thresholds.
The Threshold profiles page appears.
2. Select an existing profile or create a new one. The Threshold profile opens.
3. Click New item. The Threshold item window appears.
4. Go to the Script-based tab.
5. Fill out the threshold item:
- *Alert title: Enter the alert title (e.g., "Critical Battery Capacity Notification").
Note: This is the name that appears in the Description column on the Alerts page. - *Monitoring script: Select the script
- Alert severity: Select 'Information', 'Warning', or 'Critical'.
- Threshold value type: Select 'Text 'or 'Number'.
- Operator: Select 'Equals', 'Greater than', 'Lower than', or 'not equals'.
- Value: Set the value.
- Time period: Set the time period.
- Auto-healing script: Select an auto-healing script.
For example:- You have a script that monitors battery health.
- If the battery capacity drops below 60%, output whatever the numerical value is.
- Add the script to the threshold item.
- For the threshold value type, select Number.
- For the operator, select Lower than.
- For the value, enter 60.
- The script will output the battery capacity value when it drops below 60%. This output will then activate the threshold profile item, which will in turn create an alert.
- You have a script that monitors battery health.
6. Click Add.
The script-based threshold item is added to the threshold profile.
7. Click Save.
The threshold profile is updated to include the script-based threshold item. If triggered, alerts will appear on the Alerts page.
To add a monitoring script to your script-based threshold item:
1. Under Monitoring script, click Select.
The Select script window appears.
2. In the My scripts tab, click Select on the script you want to add.
Note: You can also create or search the Shared Script Library for scripts.
The monitoring script appears in the threshold item.
3. Complete the threshold item