We have a number of services (mostly console applications) running across several remote computers.
I need to implement some form of a watchdog to make sure all these services are running as expected.
Some services are executed via Windows Task Scheduler, and some are long-running apps.
What would be the best way of logging that those applications are run? I don't want to modify my running services.
I have administrator access to all machines.
A few options comes to mind:
For the long running applications:
Use psexec
and retrieve a list of running processes and make sure my application is in that list.
For tasks invoked by task scheduler:
Use psexec
and query schtasks
and find out when my services was run and what the return code was.
Do you have any other ideas of doing this?
For the record, this will be implemented in C#/WPF.
EDIT:
Ok, I solved this in a pretty straight forward way. Thanks for your input.
Source: http://pastebin.com/fr6dDMp5