Page 1 of 1

problem with NRPE

Posted: Sat Feb 06, 2016 8:50 am
by nagpat
Hello,

i ve a problem with the nrpe plugin. the server and the host are in the same network.
in command line i can remote informations, by example :

Code: Select all

/usr/lib/nagios/plugins# ./check_nrpe -H 172.16.1.3
NRPE v2.15
/usr/lib/nagios/plugins# ./check_nrpe -H 172.16.1.3 -c check_load
OK - Charge moyenne: 0.00, 0.02, 0.05|load1=0.000;15.000;30.000;0; load5=0.020;10.000;25.000;0; load15=0.050;5.000;20.000;0; 
/usr/lib/nagios/plugins# ./check_nrpe -H 172.16.1.3 -c check_users
UTILISATEURS OK - 0 utilisateurs actuellement connectés sur |users=0;5;10;0
/usr/lib/nagios/plugins# ./check_nrpe -H 172.16.1.3 -c check_disk
DISK OK - free space: / 5104 MB (74% inode=85%);| /=1787MB;5824;6552;0;7280
/usr/lib/nagios/plugins# ./check_nrpe -H 172.16.1.3 -c check_mem
<b>CRITICAL: Memory Usage (W> 90, C> 80): 89% <br>Swap Usage (W> 100, C> 100): 0%</b>|MemUsed=89%;90;80 SwapUsed=0%;100;100
but in the web interface, i can't see informations needed, example :

Code: Select all

Current Load     
	UNKNOWN 	2016-02-06 13:47:32 	1d 21h 11m 46s 	4/4 	CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages. 
	
Current Users
	UNKNOWN 	2016-02-06 13:43:25 	1d 21h 11m 47s 	4/4 	CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages. 
	
Disk Space
	UNKNOWN 	2016-02-06 13:47:36 	1d 21h 10m 49s 	4/4 	CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages. 
	
Memory
	UNKNOWN 	2016-02-06 13:47:17 	1d 15h 34m 8s 	4/4 	CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages. 
i can see just : the "UNKNOWN" state, and "CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages."

i read the "NRPE-Troubleshooting-and-Common-Solutions" link : https://assets.nagios.com/downloads/nag ... utions.pdf , but there's no solution for me.

indeed, my remote nrpe.cfg is "dont_blame_nrpe=1"

but as in command line the informations pass, i don't think it is a firewall's problem.

someone maybe know a solution ?

thx by advance.

Re: problem with NRPE

Posted: Sun Feb 07, 2016 10:11 pm
by Box293
Can you please post the service definition for these services in question.

Go into CCM
Click Monitoring > Services
Find the service with the issue
Click the Disk icon
Paste that text here in a code block

Re: problem with NRPE

Posted: Mon Feb 08, 2016 3:43 am
by nagpat
by example for the check_load i tryied in two ways :

firstly :

- for the nagios service i tryied :

Code: Select all

check_nrpe!check_load!5.0!3.0!2.0!20.0!15.0!10.0
or

Code: Select all

check_nrpe!check_load!5.0 3.0 2.0!20.0 15.0 10.0
or

Code: Select all

check_nrpe!check_load!5.0,3.0,2.0!20.0,15.0,10.0
- in the nrpe.cfg (host)

Code: Select all

command[check_load]=/usr/lib/nagios/plugins/check_load  -w $ARG1$ -c $ARG2$
in service :

Code: Select all

To expand:	check_nrpe!check_load!5.0,3.0,2.0!20.0,15.0,10.0
check_nrpe 	/usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
-> 	/usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c check_load -a 5.0,3.0,2.0
unused: 	$ARG3$=20.0,15.0,10.0
and secondly :

- for the nagios service :

Code: Select all

check_nrpe!check_load
- in the nrpe.cfg (host) :

Code: Select all

command[check_load]=/usr/lib/nagios/plugins/check_load -w 5,3,2 -c 20,15,10
but all failed...

i can see the log from the nrpe host :

Code: Select all

Connection from 172.16.1.2 port 6582
Feb  6 20:17:56 sec2 nrpe[28195]: Host address is in allowed_hosts
Feb  6 20:17:56 sec2 nrpe[28195]: Handling the connection...
Feb  6 20:17:56 sec2 nrpe[28195]: Error: Request contained command arguments!
Feb  6 20:17:56 sec2 nrpe[28195]: Client request was invalid, bailing out...
Feb  6 20:17:56 sec2 nrpe[28195]: Connection from #002 closed.
i modifyied the group/user owners of the check_nrpe (nagios server) and the check_load (host) :

chown nagios:nagios ...

but it is the same.

i am in the OS : raspbian jessie for the nagios server and the debian jessie for the nrpe host

Re: problem with NRPE

Posted: Mon Feb 08, 2016 10:54 am
by rkennedy
Can you try defining your warning / critical values in your NRPE.cfg like so?

Code: Select all

command[check_load]=/usr/lib/nagios/plugins/check_load -w 5,3,2 -c 20,15,10

Re: problem with NRPE

Posted: Mon Feb 08, 2016 12:52 pm
by nagpat
rkennedy wrote:Can you try defining your warning / critical values in your NRPE.cfg like so?
i do it, but nothing more than before.

i defined too the check command of the nrpe host config in nagios like it :

Code: Select all

check_nrpe!check_load!5.0,3.0,2.0!20.0,15.0,10.0
but always with the result in the nagios interface : "CHECK_NRPE: Received 0 bytes from daemon. Check th...."

just a point, i tested a nrpe plugin on an old ubuntu v10.04 lucid host (NRPE 2.12), and it pass, i can view informations coming from this ubuntu host.

is it a bug disallowing communication beetween nagios (3.5.1) and the debian nrpe plugin (2.15) ? or is there a solution ?

Re: problem with NRPE

Posted: Mon Feb 08, 2016 12:55 pm
by rkennedy
Can you post your command definition for check_nrpe?

[resolved][résolu] Re: problem with NRPE

Posted: Mon Feb 08, 2016 3:09 pm
by nagpat
Thx :)

when i wrote the command definition for check_nrpe in /etc/nagios3/command.cfg and i reloaded nagios, there was an error, then i thank it was written elsewhere (then i deleted it), and indeed after this question, i find it here now : /etc/nagios-plugins/config/check_nrpe.cfg :

Code: Select all

# this command runs a program $ARG1$ with arguments $ARG2$
define command {
        command_name    check_nrpe
        command_line    /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}
# this command runs a program $ARG1$ with no arguments
define command {
        command_name    check_nrpe_1arg
        command_line    /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
i understand better the problem and now with check_nrpe_1arg in place of check_nrpe, and all is OK in the web interface of nagios :]

problem resolved !
thx rkennedy !