Create a Windows PowerShell Script monitor
You can use the Windows PowerShell script monitor to run custom PowerShell scripts in SAM that monitor Windows-based computers.
Before coding and testing your script, review the following resources:
Your organization should internally review and assess to what extent PowerShell is incorporated into your environment. This is especially important when importing scripts from third parties, including content posted by other customers in the SolarWinds online IT community, THWACK. To learn more, see Use PowerShell in SAM.
To create a Windows PowerShell script monitor:
Click Settings > All Settings > SAM Settings and click Manage Templates.
The Manage Application Monitor Templates page opens. All available out-of-the-box and custom templates display.
Search to locate, select, and edit an existing template or click Create New Template.
- Click Add Component Monitor(s) and choose Manually Add Component Monitors.
Search for PowerShell. When displayed, select the Windows PowerShell Monitor and click add.
- Enter all arguments and parameters for the Script Arguments.
- Click Edit Script to enter and test the script.
Test the script by selecting settings for the output, specified node, and specified credentials. Click Get Script Output.
Output results display using the script code with success or failure and any additional notes.
Click Get Script Output to generate the output and click Save.
The metrics save to outputs to configure as part of the component monitor. These outputs display at polling intervals for the template.
- When complete, click Submit to save the template.
When tested, output generates into customizable sections. Each output section is named by the Unique ID with a Display Name you can edit.
For each output, you can optionally:
- Convert the value using selected formulas.
- Configure statistic thresholds to refine alerting for the component monitor. Set the warning and critical thresholds with specific values or baseline data.
- Select a roll-up status sort option to display the best or worst status up through the template and component monitor.
- Add notes to describe the script output.