This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Questions calling a PowerShell script via alert

I have seen a few posts regarding running a PS script through alerts actions but I still had questions.

Below is a screenshot of what I think should work.  

This is the call: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -Command "C:\scripts\ClusterServiceMonitor.ps1"

Does the script get called from the local server or does it call to the primary Solarwinds server to get the script?  Does the context of this command look good?

sjanssen_0-1606839514265.png

Here is a post I found: https://thwack.solarwinds.com/t5/SAM-Discussions/Is-it-possible-to-call-a-PowerShell-script-from-the-quot-Execute/m-p/140360

  • All alert actions run on the primary application server only, here is an example of one of mine calling a powershell script and passing it a mess of arguments.

    C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -Command "& {& "D:\PS_SW_Alerts\omnibusPostEifMsg.ps1" -locale PROD -actionType triggerWarning -messageType Component -alertObjectID ${N=Alerting;M=AlertObjectID} -objectID ${N=SwisEntity;M=Application.ApplicationID} -alertName ${N=Alerting;M=AlertName} -node '${N=SwisEntity;M=Application.Node.Caption}' -sitOrigin '${N=SwisEntity;M=Application.ApplicationAlert.ApplicationName}' -sitDisplayItem '${N=SwisEntity;M=ComponentAlert.ComponentName}' -appName '${N=SwisEntity;M=Application.ApplicationAlert.ApplicationName}' -compAvailability ${N=SwisEntity;M=ComponentAlert.ComponentAvailability} }"

  • Hi,

    Please help us with your script.

    I need this to pass some argument to script.