Check_nrpe script is not working

Kent Saunders kgs at uvm.edu
Wed Jun 10 20:43:40 CEST 2009


Can you use check_nrpe to run any other checks? I'd assume not since you 
have "allowed_hosts=127.0.0.1" set in your nrpe.cfg file. Change that IP 
address to your nagios servers ip, then try again. If still having 
problems, confirm that check_disk is working with nrpe fine before 
digging into custome scripts.

-kent

Joe Hammerman wrote:
>
> Good morning Nagios users list. I am hoping that someone here would be 
> kind enough to take a look at this problem I’m having. I’m stumped so 
> any troubleshooting steps would be greatly appreciated!
>
> A short summary of the problem is this: a script called by the nagios 
> user on the target machine runs without error. However, when the 
> script is called by the remote check_nrpe script it fails, with 
> apparently no output.
>
> The check_nrpe script is configured to call a command that calls an HP 
> script, which then parses the output. Here is the command directive:
>
> command[hplog_fan.pl]=/usr/local/nagios/libexec/videoegg/hplog_fan.pl
>
> Here is the contents of the script:
>
> #!/usr/bin/perl
>
> @output = `sudo /sbin/hplog -f`;
>
> unless (scalar @output > 1){
>
> print "hplog isnt outputting";
>
> exit(3);
>
> }
>
> foreach(@output){
>
> if (/^ \d/){
>
> unless (/Normal/){
>
> print;
>
> exit(2);
>
> }
>
> }
>
> }
>
> print "Ok HP Proliant fans";
>
> exit(0);
>
> __END__
>
> t at db032 ~]# hplog -f
>
> ID TYPE LOCATION STATUS REDUNDANT FAN SPEED
>
> 1 Basic Fan System Board Normal Yes -------
>
> 2 Basic Fan System Board Normal Yes -------
>
> 3 Basic Fan System Board Normal Yes -------
>
> 4 Basic Fan System Board Normal Yes -------
>
> 5 Basic Fan I/O Zone Normal Yes -------
>
> 6 Basic Fan I/O Zone Normal Yes -------
>
> Here is the script running without error when called by the local 
> Nagios user:
>
> [nagios at inf001.sfota ~]$ /usr/local/nagios/libexec/videoegg/hplog_fan.pl
>
> Ok HP Proliant fans
>
> [nagios at inf001.sfota ~]$ echo $?
>
> 0
>
> Here is the script failing when being called remotely:
>
> [jhammerman at adm001.udev libexec]$ ./check_nrpe -H 
> inf001.sfota.videoegg.com -c hplog_power.pl
>
> hplog isn't outputting
>
> The variable @output is empty.
>
> Check_nrpe is configured to run as Nagios (Xinetd definition):
>
> service nrpe
>
> {
>
> flags = REUSE
>
> socket_type = stream
>
> port = 5666
>
> wait = no
>
> user = nagios
>
> group = nagios
>
> server = /usr/local/nagios/bin/nrpe
>
> server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd
>
> log_on_failure += USERID
>
> disable = no
>
> only_from = 127.0.0.1 10.11.1.10 10.11.1.11 192.168.101.10 192.168.101.11
>
> }
>
> The source machine is in the allowed list above – the command also 
> fails if run against localhost on the target machine, using it’s own 
> check_nrpe binary.
>
> Here is the log output if debug is set to 1:
>
> Jun 10 10:49:38 inf001 xinetd[20658]: START: nrpe pid=20991 
> from=192.168.101.11
>
> Jun 10 10:49:38 inf001 nrpe[20991]: INFO: SSL/TLS initialized. All 
> network traffic will be encrypted.
>
> Jun 10 10:49:38 inf001 xinetd[20658]: EXIT: nrpe status=0 pid=20991 
> duration=0(sec)
>
> In the interest of completeness, the nrpe.cfg is attached to this email.
>
> Regards,
>
> Joseph Hammerman
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing 
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
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