Goal: when application Y on server X goes down, the application owner would like to capture the logs.
Components:
- An alert is configured to monitor application Y on server X. An assigned action emails the application owner and the systems engineers when its status is down (and the node is not also down).
- A PowerShell script has been written which pulls copies of 4 text-based log files, compresses them, and emails the package to the application owner.
Problem: The script does not run when I put it in an execution action and assign the action to the alert.
The action's command is: C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -NonInteractive -NoProfile -Command "&{Invoke-Command -FilePath C:\Scripts\ScriptName.ps1 -ComputerName ServerX}"
This works perfectly when run from the command line on my Orion poller. It also works perfectly when run locally on serverX.
What is missing in my setup to make this work in an Orion action?