<div>Yes this can be done in NC_Net </div>
<div>but depending on your goals the service could also be configured to restart if it stop</div>
<div> </div>
<div>For NC_Net</div>
<div>First make sure you are using a current version of Nc_Net </div>
<div>Sourceforge is the only location that NC_Net should be downloaded from.</div>
<div><a href="http://sourceforge.net/projects/nc-net">http://sourceforge.net/projects/nc-net</a></div>
<div> </div>
<div>Use the RUNSCRIPT command check help for syntex</div>
<div>./check_nc_net --help=RUNSCRIPT </div>
<div> </div>
<div>create a batch that runs the net start command.</div>
<div>copy it into the script folder of NC_Net install folder.</div>
<div>Make sure your startup.cfg is configured approprialty for running scripts. (documentation is clear for these settings in the Startup.cfg file in the config folder of NC_NEt install location)</div>
<div>if you modified the starup make sure to restart NC_NEt</div>
<div> </div>
<div>Then configure a event script for nagios  that calls check_nt -v RUNSCRIPT -l "Scriptname"<br></div>
<div>Tony (Author of NC_NEt)<br></div>
<div class="gmail_quote">On Thu, Apr 10, 2008 at 2:12 PM, Frost, Mark {PBG} <<a href="mailto:mark.frost1@pepsi.com">mark.frost1@pepsi.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span>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></span></font> </div>
<div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span>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></span></font> </div>
<div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span>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></span></font> </div>
<div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span>3) Your script from #1 would then run</span></font></div>
<div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span></span></font> </div>
<div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span>check_nrpe -H <hostname> -c start_service\!<servicename></span></font></div>
<div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span></span></font> </div>
<div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span>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></span></font> </div>
<div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span>Mark</span></font></div>
<div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span></span></font> </div>
<div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span></span></font> </div><br>
<blockquote dir="ltr" style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<div lang="en-us" dir="ltr" align="left">
<hr>
<font face="Tahoma" size="2"><b>From:</b> <a href="mailto:nagios-users-bounces@lists.sourceforge.net" target="_blank">nagios-users-bounces@lists.sourceforge.net</a> [mailto:<a href="mailto:nagios-users-bounces@lists.sourceforge.net" target="_blank">nagios-users-bounces@lists.sourceforge.net</a>] <b>On Behalf Of </b>Joe Astrologo<br>
<b>Sent:</b> Thursday, April 10, 2008 1:39 PM<br><b>To:</b> <a href="mailto:Nagios-users@lists.sourceforge.net" target="_blank">Nagios-users@lists.sourceforge.net</a><br><b>Subject:</b> [Nagios-users] How to start/stop a windows service using nagios<br>
</font><br></div>
<div>
<div></div>
<div class="Wj3C7c">
<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></div></div></blockquote></div><br>-------------------------------------------------------------------------<br>This SF.net email is sponsored by the 2008 JavaOne(SM) Conference<br>Don't miss this year's exciting event. There's still time to save $100.<br>
Use priority code J8TL2D2.<br><a href="http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone" target="_blank">http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone</a><br>
_______________________________________________<br>Nagios-users mailing list<br><a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>::: Messages without supporting info will risk being sent to /dev/null<br></blockquote></div><br>