I have a unique scenario that i needed to account for to trigger a HA failover in SolarWinds. This PowerShell script is used as an alert action and requires the PoolID to be passed into it.
My Alert Action is configured as followed.
The text inside of the 'Network path to external program contains:
C:\windows\system32\windowspowershell\v1.0\powershell.exe -ExecutionPolicy unrestricted -command "C:\Support\Scripts\Alert_Agent_Status_HA_Failover.ps1 ${N=SwisEntity;M=PoolId}"
Setup Considerations:
- You will need to update the path in the text above with the location you save this script (<C:\Support\Scripts\>).
- If you are using HA on your Main SolarWinds Server, you will want to ensure that path is accessible by both servers or save this script in the same location on both servers.
- IMPORTANT: You will also need to have a SolarWinds Admin approve the script once it is implemented in your environment. Details on this approval are found here:
https://documentation.solarwinds.com/en/success_center/orionplatform/content/core-approve-execute-alert-action.htm