A "might be enough" version of this is built into Windows. Look into the "Recovery" tab of the service properties, as available via services.msc.
You can act on a service fail with:
"Restart the Service"
"Run a Progam"
"Restart the Computer"
"Run a program" could be a small script that sends a mail, for example.
If you want a bigger solution with an overview dashboard and all, there are plenty of system monitoring solutions available. For example SolarWinds IPMonitor comes to mind, or Nagios, or Cacti.
If you are interested in some .NET programming, The System.ServiceProcess namespace provides classes that allow you to implement, install, and control Windows service applications.
Simple example, checking and starting a service in C#:
var srv = new ServiceController("MyService");
Console.WriteLine("MyService Status {0}", srv.Status);
if (srv.Status != ServiceControllerStatus.Running)
srv.Start();
Also, I want to point out the wmic tool.
wmic /node:[hostname] service list
is able to list the services of any computer
WMIC SERVICE where caption='TELNET' CALL STARTSERVICE
would restart the telnet service.
If you encapsulate wmic in a script language (able to send email), you can have the monitoring tool you are looking for
-
Edited by
Andrey Langovoy
Friday, July 31, 2015 5:40 AM