<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Verdana; font-size: 10pt; color: #000000'>Sorry, the page is http and not https. <span class="Object" id="OBJ_PREFIX_DWT7847"><a target="_blank" href="http://www.opservices.com.br/agentes">http://www.opservices.com.br/agentes</a></span>, you need use an event_handler to call the command.<br><br><div>[]'s<br>Paulo Ribas<br>www.opservices.com.br<br><div></div></div><br><br>----- "Jonathan Williams" <jonathan.williams@us.g4s.com> wrote:
<br>>
<style></style>
<link href="/zimbra/css/msgview.css?v=080626022332" rel="stylesheet">
<div class="Section1">
<p class="MsoNormal"><font face="Verdana" size="2" color="black"><span style="font-size: 10pt; font-family: Verdana; color: black;"><a href="https://www.opservices.com.br/agentes" target="_blank">https://www.opservices.com.br/agentes</a>
I get a page not found. I can look around for it. Is this agent installed on
the host along with the NSClient? Also is the command created in the
windows.cfg like my example below where I define the command in the config and
than under the service definition I use an event handler to call that command?</span></font></p>
<p class="MsoNormal"><font face="Verdana" size="2" color="black"><span style="font-size: 10pt; font-family: Verdana; color: black;"> </span></font></p>
<p class="MsoNormal"><font face="Verdana" size="2" color="black"><span style="font-size: 10pt; font-family: Verdana; color: black;">Thanks again,</span></font></p>
<p class="MsoNormal"><font face="Verdana" size="2" color="black"><span style="font-size: 10pt; font-family: Verdana; color: black;"> </span></font></p>
<p class="MsoNormal"><font face="Verdana" size="2" color="black"><span style="font-size: 10pt; font-family: Verdana; color: black;">Jon</span></font><font face="Courier New" size="2" color="blue"><span style="font-size: 10pt; font-family: "Courier New"; color: blue;"></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2" color="blue"><span style="font-size: 10pt; font-family: "Courier New"; color: blue;"> </span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2" color="blue"><span style="font-size: 10pt; font-family: "Courier New"; color: blue;"> </span></font></p>
<div>
<div class="MsoNormal" style="text-align: center;" align="center"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">
<hr size="2" width="100%" align="center">
</span></font></div>
<p class="MsoNormal"><b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">From:</span></font></b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> Paulo Ribas
[mailto:paulo.ribas@opservices.com.br] <br>>
<b><span style="font-weight: bold;">Sent:</span></b> Friday, July 11, 2008 11:54
AM<br>>
<b><span style="font-weight: bold;">To:</span></b> Jonathan Williams<br>>
<b><span style="font-weight: bold;">Cc:</span></b>
nagios-users@lists.sourceforge.net<br>>
<b><span style="font-weight: bold;">Subject:</span></b> Re: [Nagios-users] Help -
I am unable to get the NSClient++ to restart services</span></font></p>
</div>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>
<div>
<p class="MsoNormal" style="margin-bottom: 12pt;"><font face="Verdana" size="2" color="black"><span style="font-size: 10pt; font-family: Verdana; color: black;">if
you need to restart a service in the windows, you can install the OpMon Agent
downloaded from the following URL https://www.opservices.com.br/agentes . After
installing the agent, create the command: <br>>
check_nrpe -H $HOSTADDRESS$ 5666 -n -c service_control -a
"NAME_OF_SERVICE" stop or start.<br>>
<br>>
</span></font></p>
<div>
<p class="MsoNormal"><font face="Verdana" size="2" color="black"><span style="font-size: 10pt; font-family: Verdana; color: black;">[]'s<br>>
--<br>>
Paulo Ribas<br>>
www.opservices.com.br</span></font></p>
</div>
<p class="MsoNormal"><font face="Verdana" size="2" color="black"><span style="font-size: 10pt; font-family: Verdana; color: black;"><br>>
<br>>
----- "Jonathan Williams" wrote: <br>>
> </span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2" color="black"><span style="font-size: 10pt; font-family: "Courier New"; color: black;">Hello
everyone, I am new to Nagios and am looking for some help. I
already posted this in the forum as well. I can successful get Nagios to
monitor any service I need, but I can’t get it to restart. Here is my
situation up to date: (from the forums)</span></font><font color="black"><span style="color: black;"></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2" color="black"><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> </span></font><font color="black"><span style="color: black;"></span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="2" color="blue"><span style="font-size: 10pt; color: blue;">I did make sure event handler was enabled,
but the documentation refers to scripting the start up of linux services, not
Windows. I figured I can create a .bat file to do a simple net start, but how
does Nagios run it? Is it something like this? (example of the server service)<br>>
> <br>>
> define service{<br>>
> host_name somehost<br>>
> service_description Server Service<br>>
> max_check_attempts 4<br>>
> event_handler restart_server<br>>
> }<br>>
> <br>>
> Than for the handler command:<br>>
> define command{<br>>
> command_name restart-httpd<br>>
> (This is where I am unsure. Do I give it a path to the .bat file?)<br>>
> <br>>
> Is nagios able to run this file from the host PC. In these linux script
examples I am unsure if the script is on the Nagios server of the host server.
Any help would be awesome. Hopefully I'm close to accurate here.</span></font><font color="black"><span style="color: black;"></span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="3" color="black"><span style="font-size: 12pt; color: black;"> </span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="3" color="black"><span style="font-size: 12pt; color: black;">I got a reply:</span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="3" color="black"><span style="font-size: 12pt; color: black;"> </span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="2" color="blue"><span style="font-size: 10pt; color: blue;">You can use NRPE/NSClient++ and instead of
using it to run remote scripts to check something, use it to restart your
services. See</span></font><font color="black"><span style="color: black;"><br>>
> <br>>
> <a href="http://nagios.sourceforge.net/docs/3_0/monitoring-windows.html" target="_blank">http://nagios.sourceforge.net/docs/3_0/monitoring-windows.html</a><br>>
> <a href="http://trac.nakednuns.org/nscp/" target="_blank">http://trac.nakednuns.org/nscp/</a></span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="3" color="black"><span style="font-size: 12pt; color: black;"> </span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="3" color="black"><span style="font-size: 12pt; color: black;">However still cant get NSClient to start
the service. The links provided detail how to set up monitor host
services. This works great. However I cannot get the NSCLient++ to actually
restart the service. I edited the NSC.INI file to comment out the
"check_all_services" section and have the values set to
"started" however it still shows the service as stopped and it will
not restart it. I am assuming there is a step I am missing in this in some
config file somewhere. Any help would be greatly appreciated as I am under a
deadline to have this up by this weekend. Management thought this would be
easier than it is and gave me two days.</span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="3" color="black"><span style="font-size: 12pt; color: black;"> </span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="3" color="black"><span style="font-size: 12pt; color: black;">Any help on what I am missing would be
greatly appreciated.</span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2" color="black"><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> </span></font><font color="black"><span style="color: black;"></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2" color="black"><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> </span></font><font color="black"><span style="color: black;"></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2" color="black"><span style="font-size: 10pt; font-family: "Courier New"; color: black;">Jonathan
Williams</span></font><font color="black"><span style="color: black;"></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2" color="black"><span style="font-size: 10pt; font-family: "Courier New"; color: black;">Sr. Systems
Administrator</span></font><font color="black"><span style="color: black;"></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2" color="black"><span style="font-size: 10pt; font-family: "Courier New"; color: black;">G4S Justice
Services, Inc.</span></font><font color="black"><span style="color: black;"></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2" color="black"><span style="font-size: 10pt; font-family: "Courier New"; color: black;">Tel:
800.589.6003 ext 1308</span></font><font color="black"><span style="color: black;"></span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2" color="black"><span style="font-size: 10pt; font-family: "Courier New"; color: black;"><a href="mailto:jonathan.williams@us.g4s.com" target="_blank">jonathan.williams@us.g4s.com</a></span></font><font color="black"><span style="color: black;"></span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="3" color="black"><span style="font-size: 12pt; color: black;"> </span></font></p>
<p class="MsoNormal"><font face="Verdana" size="2" color="black"><span style="font-size: 10pt; font-family: Verdana; color: black;"><br>>
> -------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have
shown that voting for your favorite open source project, along with a healthy
diet, reduces your potential for chronic lameness and boredom. Vote Now at
http://www.sourceforge.net/community/cca08<br>>
> _______________________________________________ Nagios-users mailing list
Nagios-users@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</span></font></p>
</div>
</div>
</jonathan.williams@us.g4s.com></div></body></html>