I have an application that when a service hangs files begin accumulate in a folder. So to monitor it, I applied a File Count Monitor and alert on it. This works great! The issue I'm having is trying to restart the service (and stop the FTP service to stop incoming files). However, since I'm not monitoring that service (because it appears fine) I dont have a componentID to use the restart service rule. So, I created a rule to run a batch file that utilizes SysInternals psservice. This way I can pass service account and password (even though it's clear text
) since the Solarwinds Alerting Engine runs as the local system account, and has no way to run against the remote machine. My rule looks like this:

and the batch file like this:
s:\scripts\psservice.exe \\%1 -u mydomain\myserviceaccount -p sapassword stop ftpsvc
s:\scripts\psservice.exe \\%1 -u mydomain\myserviceaccount -p mysapassword stop myservice
timeout 5
s:\scripts\psservice.exe \\%1 -u mydomain\myserviceaccount -p mysapassword start myservice
When I run it from a command prompt it works, I check the event log and see the services stop successfully.
When I run a test of the Orion Alert I see the result below:
10/18/2012 8:54:25 PM: | Alert 'Server - Email & Page - EPS Large File Count': Success - S:\scripts\EPS-down.bat WEPST01.phpds.org |
10/18/2012 8:54:25 PM: | Action type ExecuteProgram for alert 'Server - Email & Page - EPS Large File Count' completed successfully. |
However, no event logs and the ftpsvc is still running.
I'd really appreciate any help you can offer. Thanks!