Restart Windows Service if down...

orh at kn24.no orh at kn24.no
Thu Jun 17 15:30:26 CEST 2004


Hi;

To (re)start a service in Windows the command "net start <servicename>" should do. 
We're currently using NSClient to monitor the Windows' boxes, and it doesn't supply 
any means of remotely executing arbitrary commands, afaik. NRPE may be able to do 
this. 

However, at least in W2K and later, it is possible to specify service recovery options, 
so that a failing service will cause an action on the system in question. One of the 
alternatives is to simply restart the failing service. Another is to execute a file. 

One possibility here would be to create a batch file containing the appropriate "net 
start" command, as well as a command to submit a passive service check result to 
Nagios, notifying Nagios that the service in question has failed. If it is desirable to 
reboot the system with the failing service, the batch file could first submit the check 
result to Nagios, and secondly reboot the system with the shutdown utility.

Best regards
-Odd-Rune

> 
> 
> On Thu, 17 Jun 2004 10:41 , Andreas Ericsson <ae at op5.se> sent:
> 
> >Or you could do it with nrpe_nt. Just issue an
> >int 0x10
> >in assembly and the machine will reboot. You might want to add a 
> >diskflush call before that though.
> 
> 
> there is something called shutdown.exe on sysinternal.com - from a windows box, you simply run a batch that shuts down the remote 
> machine.  If you have a windows web-server somewhere, the nagios can call a web page from the webserver that then executes the remote 
> shutdown of any windows box...you probably could figure out a way to call it directly from the linux box as well
> 
> >
> >Martin, Stanley G [CGEY Contractor for Sprint] wrote:
> >> The only way I've been able to do it is to have something on the Windows box that you can call from Nagios and pass the service name to 
> restart. I have a daemon that is written in Perl that runs on our Windows boxes and we just call that using an Event Handler script.
> >> 
> >> Stanley G. Martin
> >> System Administrator
> >> Sprint - EAS Business Intelligence 
> >> Stanley.G.Martin at mail.sprint.com
> >> 
> >> 
> >> -----Original Message-----
> >> From: nagios-users-admin at lists.sourceforge.net [nagios-users-admin at lists.sourceforge.net','','','')">nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Wengrzik, Andreas
> >> Sent: Wednesday, June 16, 2004 9:32 AM
> >> To: nagios-users at lists.sourceforge.net
> >> Subject: [Nagios-users] Restart Windows Service if down...
> >> 
> >> Hello!
> >> 
> >> Anyone knows if it´s possible to start or restart services in windows if some service runs into failure??
> >> 
> >> Thanks for your help!
> >> 
> >> 
> >> -------------------------------------------------------
> >> This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
> >> Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
> >> Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
> >> REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
> >> _______________________________________________
> >> Nagios-users mailing list
> >> Nagios-users at lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/nagios-users
> >> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
> >> ::: Messages without supporting info will risk being sent to /dev/null
> >> 
> >> 
> >> -------------------------------------------------------
> >> This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
> >> Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
> >> Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
> >> REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
> >> _______________________________________________
> >> Nagios-users mailing list
> >> Nagios-users at lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/nagios-users
> >> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
> >> ::: Messages without supporting info will risk being sent to /dev/null
> >> 
> >
> >-- 
> >Andreas Ericsson
> >OP5 AB
> >+46 (0)733 709032
> >andreas.ericsson at op5.se
> >
> >
> >-------------------------------------------------------
> >This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
> >Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
> >Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
> >REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
> >_______________________________________________
> >Nagios-users mailing list
> >Nagios-users at lists.sourceforge.net
> >https://lists.sourceforge.net/lists/listinfo/nagios-users
> >::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
> >::: Messages without supporting info will risk being sent to /dev/null
> 
> -------------------------------------------
> Chris McKeever
> If you want to reply directly to me, please use cgmckeever--at--prupref.com
> <A href="http://www.prupref.com">Chicago</A><A href="http://chicago.prupref.com">Real Estate</A>
> >
> 
> 
> 
> ---- Prudential Preferred Properties   www.prupref.com
> Success Driven By Results
>    Results Driven By Commitment
>       Commitment Driven By Integrity
>          We Are Prudential Preferred Properties
>                




-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list