Help - I am unable to get the NSClient++ to restart services

Jonathan Williams jonathan.williams at us.g4s.com
Fri Jul 11 20:39:37 CEST 2008


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)

 

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)

define service{
host_name somehost
service_description Server Service
max_check_attempts 4
event_handler restart_server
}

Than for the handler command:
define command{
command_name restart-httpd
(This is where I am unsure. Do I give it a path to the .bat file?)

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.

 

I got a reply:

 

You can use NRPE/NSClient++ and instead of using it to run remote
scripts to check something, use it to restart your services. See

http://nagios.sourceforge.net/docs/3_0/monitoring-windows.html
http://trac.nakednuns.org/nscp/

 

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.

 

Any help on what I am missing would be greatly appreciated.

 

 

Jonathan Williams

Sr. Systems Administrator

G4S Justice Services, Inc.

Tel: 800.589.6003 ext 1308

jonathan.williams at us.g4s.com

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20080711/fe32c24b/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
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
-------------- next part --------------
_______________________________________________
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