cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 10

Unable to execute Powershell scripts from Trigger Actions after 2020.2.1 HF2 install

Jump to solution

All of my alerts using powershell scripts in the trigger actions are unable to execute. This occurred immediately after the 2020.2.1 HF2 install (from 2020.2.1 HF1). Is anyone else experiencing this? This is a critical issue for me. I have a case opened with SW Support, but could use some community help in the meantime.

Tags (2)
0 Kudos
1 Solution

We found out the problem. Somewhere during the HF2 install (may not have been the HF itself), the OrionSDK installation broke. This was evident in a few logs stating various SwisPowersell paths could not be found when executing the script. I tried uninstalling the SwisPowershell module and reinstalling it with no luck.

It wasn't until we were on the phone with support that they informed me that it's the OrionSDK that actually runs the SwisPowershell and other components. The solution was to simply remove and reinstall the OrionSDK. This fixed our entire issue.

View solution in original post

4 Replies

Is the action running under a specified user account?  Can you try to CMD launch the same script from the same account?  If one isn't specified you might try testing it using your cred to compare

- Marc Netterfield, Github
0 Kudos

Seeing this made me have a small panic attack but i can say I applied the patch yesterday and my alerts to launch scripts are still operating as expected.  Do you have any kind of error messages associated with the failures or are they just not running anything?

For the sake of comparison this is one of my action strings

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -Command "& {& D:\pathtofile\filename.ps1" -args }"

 

Also if you don't already have one I find it very helpful to make sure all my scripts generate log files whenever they are called that are separate from the ones Orion makes natively.  I want to see what every variable I pass resolves to and all the timestamps for when the scripts get called, or if they don't call at all.

- Marc Netterfield, Github
0 Kudos

We found out the problem. Somewhere during the HF2 install (may not have been the HF itself), the OrionSDK installation broke. This was evident in a few logs stating various SwisPowersell paths could not be found when executing the script. I tried uninstalling the SwisPowershell module and reinstalling it with no luck.

It wasn't until we were on the phone with support that they informed me that it's the OrionSDK that actually runs the SwisPowershell and other components. The solution was to simply remove and reinstall the OrionSDK. This fixed our entire issue.

View solution in original post

You give me hope it's something minor causing this.

Here's an example of my execution string from the trigger action:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -command {d:\path\filename.ps1 -AlertObjectID ${N=Alerting;M=AlertObjectID} -EventAction "trigger"}

 

I do see this in the ActionsExecutionAlert.log:

SolarWinds.Orion.Core.Actions.Exceptions.ActionExecutionFailedException: Execute program failed with exit code 1
at SolarWinds.Orion.Core.Actions.Impl.ExecuteExternalProgram.ExecuteExternalProgramExecutor.ExecuteInternal()
at SolarWinds.Orion.Core.Actions.ActionExecutorBase.Execute(IServiceProvider serviceProvider, ActionDefinition definition, ActionContextBase context, CancellationToken cancellationToken)

 

 

Anything jump out at you guys? Logging is added to the script but the script isn't even executing, so no output.

0 Kudos