C # remote watchdog

We have several services (mainly console applications) running on several remote computers.

I need to implement some form of watchdog timer to make sure all these services are running as expected.

Some services are performed using the Windows Task Scheduler, and some of them are long-running applications.

What would be the best way to register these applications? I do not want to change my running services.

I have administrator access to all machines.

Several options come to mind:

For long-term applications: Use psexec and get a list of running processes and make sure my application is on this list.

For tasks called by the task scheduler: Use psexec and query schtasks and find out when my services were started and what the return code was.

Do you have any other ideas?

For the record, this will be implemented in C # / WPF.

EDIT:

Well, I decided it pretty straight forward. Thanks for your input.

Source : http://pastebin.com/fr6dDMp5

+4
source share
3 answers

As I said in my question, I solved this in a fairly simple way using Process.GetProcesses(string machineName) , which can process processes on a remote machine. Source here: http://pastebin.com/fr6dDMp5

+1
source
+1
source

Have you considered using the XYNT service ( http://www.codeproject.com/KB/system/xyntservice.aspx )?

It can run console applications as a Windows service and reconfigure them if they stop. You do not need to modify existing services.

0
source

All Articles