<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2802" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=509520618-10042008>There might be more than one way to do this, but my
experience/suggestion would be to</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=509520618-10042008></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=509520618-10042008>1) setup an event to act when the service goes
critical. See the Nagios docs about how to write a simple event
script. Mostly you're making sure that you'll only attempt to start the
service on HARD/CRITICAL events.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=509520618-10042008></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=509520618-10042008>2) I'm not too familiar with NC_NET, but I believe
it's not dissimilar from NSClient++ or other NRPE agents in that it can accept
NRPE protocol requests. You'd define an NRPE command (say "start_service")
that run "net start $ARG1$" where $ARG1$ is the name of the service to
start. It's possible that NC_NET has some built-in capability to manage
services too without resorting to an actual NRPE command.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=509520618-10042008></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=509520618-10042008>3) Your script from #1 would then
run</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=509520618-10042008></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=509520618-10042008>check_nrpe -H <hostname> -c
start_service\!<servicename></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=509520618-10042008></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=509520618-10042008>to start a service. Stopping is similar, of
course.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=509520618-10042008></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=509520618-10042008>Mark</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=509520618-10042008></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=509520618-10042008></SPAN></FONT> </DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
nagios-users-bounces@lists.sourceforge.net
[mailto:nagios-users-bounces@lists.sourceforge.net] <B>On Behalf Of </B>Joe
Astrologo<BR><B>Sent:</B> Thursday, April 10, 2008 1:39 PM<BR><B>To:</B>
Nagios-users@lists.sourceforge.net<BR><B>Subject:</B> [Nagios-users] How to
start/stop a windows service using nagios<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>I have nagios 2.3 server installed on a RedHat Linux.</DIV>
<DIV> </DIV>
<DIV>I have NC_Net and nagios event_log agents installed on various windows
clinets.</DIV>
<DIV> </DIV>
<DIV>I want nagios to re-start a windows service based on an application Event
Log messages.</DIV>
<DIV> </DIV>
<DIV>How do I do it?</DIV>
<DIV> </DIV>
<DIV>Thanks.</DIV></BLOCKQUOTE></BODY></HTML>