We have about ten client computers ranging from Windows XP to Windows 7 that have a little program that runs in the tray. This program needs to be running at all times and sometimes it either crashes or a user exits the program. We would like to be able to check every hour or so to see if this program is running. If it is not running, it should be started.
I have tried using powershell on one of our servers to get the process from a remote computer and if it doesn't find it, to start it. But, that fails because it cannot start the process as an interactive user.
I tried setting up a task in task scheduler, but Windows XP task scheduler is not very good or configurable.
We would like this to be as easy to administer as possible. What would be the best way to do this?
Could you use sc.exe to run the executable as a Service?
Task scheduler can do this, the problem with it is it won't notify you if it fails. But you could put together a batch file and tlist (a free tool from Microsoft) to see what processes are running. If the batch file doesn't see it running according to tlist, you simply start it. If it's found, you use a goto to skip over everything and exit the batch file.
Do you have nagios or any monitoring system in your infrastructure ? ? If yes, it's quite simple to monitor it.
Otherwise, you could use snmp to do this job.
If you don't already run Nagios I'd be inclined to create a batch file on a monitoring machine which would run pslist piped through find on each of the client machines. If you don't see the name of the executable it's not running. You could use Blat to send you alerts.
If you do run Nagios you could run the same thing on each client as an NSClient++ check and gather the results with Nagios.