I have created a Powershell script to monitor multiple Windows Services. The script runs perfectly from a PS promt, returns the correct exit code, statistic and message. When I test the script in SolarWinds, I get the following:
Output when testing with the services all running-
Message.Status:All services are running
Statistic.Status:0
Values in the SolarWinds APM_ComponentAlertVariable table.
ComponentID MultiValueStatistics MultiValueMessages
4151 Status:0.00 Status:All services are running
Output when testing with a service stopped-
Testing on node 'XXX.XXX.XXX.XXX' failed with 'Down' status ('Down' might be different if script exits with a different exit code).
Output: ==============================================
Statistic.Status: 1
Message.Status: Apache Tomcat 9999 (Stopped)
Values in the SolarWinds APM_ComponentAlertVariable table.
ComponentID MultiValueStatistics MultiValueMessages
4151 Status:N/A Status:N/A
These values do not change as long as the service is stopped. When I restart the service, The values are updated as shown above in the "Services all running section".
Statistic.Status is the number of services down.
Message.Status is the display names of the services down.
My alert is using the ${MultiValueStatistics} and ${MultiValueMessages} variables so I get an alert stating "# of services down : N/A, Service Names: N/A".
I have atteched the script I am using in the monitor. Any guidance or help would be greatly appreciated.