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

Fernando Rocha fernando.rocha at opservices.com.br
Tue Jul 15 23:11:06 CEST 2008


Jonathan, 

The client installed on the host doesn't matter if both of them have support to nrpe. They will have a configuration file where you'll define the commands to run over check_nrpe. 

NSClient++ uses NSC.ini 
OpMonAgent uses opmonagent.ini 

But to make it easy, the OpMonAgent has a command to restart services built-in his configuration file. 

So, if you have the OpMonAgent running on host, you just need run the following command from your nagios server: 

/usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -p 5666 -n -c service_control -a "spooler" start 

But, if you are using NSClient++ you need define a command into the configuration file first, then you'll use this command in the check_nrpe. 

Fernando Rocha 
OpServices Tecnologia da Informação 

----- Original Message ----- 
From: "Jonathan Williams" <jonathan.williams at us.g4s.com> 
To: "Fernando Rocha" <fernando.rocha at opservices.com.br> 
Cc: "Nagios Users Mailinglist" <nagios-users at lists.sourceforge.net> 
Sent: Tuesday, July 15, 2008 4:57:07 PM (GMT-0300) Auto-Detected 
Subject: RE: [Nagios-users] Help - I am unable to get the NSClient++ to restart services 




I feel like I am back at square one. It seems like a simple task to get Nagios to restart a service. I have NRPE now running on the server under xinedt, and switched the client back to NSClient++ from OpMon Agent. Both support NRPE. I am not sure if I am supposed to get a service restarted with a NRPE_Check command like: 



/usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -p 5666 -n -c service_control -a "spooler" start 



Or am is supposed to create scripts on the host that will restart a service like a .bat file with a “net start spooler” command and than get an event_handler set up to call that script. It seems there are different ways to do it and I am being pulled both directions. I am new to Nagios as well as Linux and have been able to scrap my way thus far while learning a lot about both, but am about ready to call it quits. I was pointed to the NakedNuns website to the section on CheckExternalScripts, but honestly could not make much sense of it. 






From: Fernando Rocha [mailto:fernando.rocha at opservices.com.br] 
Sent: Tuesday, July 15, 2008 4:38 AM 
To: Jonathan Williams 
Cc: Nagios Users Mailinglist 
Subject: Re: [Nagios-users] Help - I am unable to get the NSClient++ to restart services 





Jonathan, 

make sure that you have the xinetd installed and check if there is the following directory: 

[root at fernando ~]# ls /etc/xinetd.d/ 
chargen-dgram daytime-dgram discard-dgram echo-dgram eklogin gssftp krb5-telnet ktalk rsync time-dgram 
chargen-stream daytime-stream discard-stream echo-stream ekrb5-telnet klogin kshell nrpe tcpmux-server time-stream 

if you don't have that, try to install by apt-get! 

and then, run the command again 

Make install-xinetd 

or you can install just writing a file like this: 
[root at fernando ~]# cat /etc/xinetd.d/nrpe 
service nrpe 
{ 
flags = REUSE 
socket_type = stream 
wait = no 
only_from = 127.0.0.1 (PUT YOURS NARIOS SERVER'S IPS HERE) 
user = nagios (PUT THE NAGIOS USER HERE) 
server = /usr/local/nagios/libexec/nrpe (THE NRPE SERVER) 
server_args = -c /usr/local/nagios/libexec/nrpe.cfg --inetd (THE NRPE CONFIG FILE) 
log_on_failure += USERID 
disable = no 
} 

and then restart xinetd! 


Fernando Rocha 
OpServices Tecnologia da Informação 


----- Original Message ----- 
From: "Jonathan Williams" <jonathan.williams at us.g4s.com> 
To: "Fernando Rocha" <fernando.rocha at opservices.com.br> 
Sent: Monday, July 14, 2008 7:07:57 PM (GMT-0300) Auto-Detected 
Subject: RE: [Nagios-users] Help - I am unable to get the NSClient++ to restart services 


I was able to compile that without ssl and was able to install the pugin’s using the following 



Make install-plugin 

Make install-daemon 

Make install-daemon-config 



Those worked finer however the next step says: 



Install the NRPE daemon as a service under xinetd 

Make install-xinetd 



I run that command and get: 

root at nagiosserver:- /downloads/nrpe-2.8# cannot create regular file ‘/ect/xinetd.d/nrpe’ No such file or directory 

make: *** [install-xinetd] Error 1 



Any thoughts?? 



Thanks, 



Jon 






From: Fernando Rocha [mailto:fernando.rocha at opservices.com.br] 
Sent: Monday, July 14, 2008 11:49 AM 
To: Jonathan Williams 
Subject: Re: [Nagios-users] Help - I am unable to get the NSClient++ to restart services 




Hi Jonathan! 

try to use the option --disable-ssl when you run ./configure 


Fernando Rocha 
OpServices Tecnologia da Informação 



----- Original Message ----- 
From: "Jonathan Williams" <jonathan.williams at us.g4s.com> 
To: "Paulo Ribas" <paulo.ribas at opservices.com.br> 
Cc: nagios-users at lists.sourceforge.net 
Sent: Monday, July 14, 2008 11:52:48 AM (GMT-0300) Auto-Detected 
Subject: Re: [Nagios-users] Help - I am unable to get the NSClient++ to restart services 

I am having a little trouble installing the NRPE 2.8 plug in Ubuntu. I am able to extract the source code tarball and than I am having issues after that. Per the instructions I am trying to compile the NRPE add-on by running 



./configure 

make all 



After I type ./configure I get a message at the end of the compile job saying “configuration error: Cannot find ssl libraries. Than if I try to go further by installing the plugins by typing make all or the individual make install-pluggin I get an error saying ** No rule to make target ‘all’. Stop. 






From: Paulo Ribas [mailto:paulo.ribas at opservices.com.br] 
Sent: Friday, July 11, 2008 2:04 PM 
To: Jonathan Williams 
Subject: Re: [Nagios-users] Help - I am unable to get the NSClient++ to restart services 




Ok, If you need, contact me. 


[]'s 
-- 



----- "Jonathan Williams" wrote: 
> 


I found the NRPE add-on (not plug-in) so I will download and install that. I’ll let you know if I run into anything. You have been more than helpful. 



Thanks, 



Jon 






From: Paulo Ribas [mailto:paulo.ribas at opservices.com.br] 
> Sent: Friday, July 11, 2008 1:49 PM 
> To: Jonathan Williams 
> Subject: Re: [Nagios-users] Help - I am unable to get the NSClient++ to restart services 




check_nrpe is part of the package nrpe, if you use ubuntu, I believe that only an "apt-get install nrpe" solve your problem. 


[]'s 
> -- 
> 


> 
> ----- "Jonathan Williams" wrote: 
> > 


OK.. I do not have check_nrpe so apparently I need to download that plug-in on by Ubuntu box. 






From: Paulo Ribas [mailto:paulo.ribas at opservices.com.br] 
> > Sent: Friday, July 11, 2008 1:42 PM 
> > To: Jonathan Williams 
> > Subject: Re: [Nagios-users] Help - I am unable to get the NSClient++ to restart services 




The commando must be: 
> > 
> > 

define command{ 

command_name restart-Spooler 

command_line PATH/ check_nrpe -H $HOSTADDRESS$ -p 5666 -n -c service_control -a "Spooler" start 

} 


> > 
> > ex: 

define command{ 

command_name restart-Spooler 

command_line /usr/local/nagios/libexec/ check_nrpe -H $HOSTADDRESS$ -p 5666 -n -c service_control -a "Spooler" start 

} 




risk being sent to /dev/null 


------------------------------------------------------------------------- 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 
_______________________________________________ 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20080715/23bfd4c2/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
-------------- 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