Page 1 of 1

Strange nrpe 4.0.3 problem

Posted: Mon Feb 08, 2021 3:28 am
by rajasegar
Hi there,

I am testing the new 4.0.3 agent and getting this weird problem

This is using 4.0.3 nrpe agent in RHEL8. It is mixing up the parameter with command.
Check using the old check_nrpe gives hints about the issue
[nagios@myucbdnagiapp01 libexec]$ ./check_nrpe -H localhost -c "rs_GetOSVersion"
Red Hat Enterprise Linux release 8.2 (Ootpa) x86_64 [myucbdnagiapp01] *NRPE v3.2.1*

[nagios@myucbdnagiapp01 libexec]$ ./check_nrpe -H localhost -c "rs_GetOSVersion" -a "linux"
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).

[nagios@myucbdnagiapp01 libexec]$ ./check_nrpe_v321r_rhel8 -H localhost -c "rs_GetOSVersion" -a "linux"
NRPE: Command 'rs_GetOSVersion!linux' not defined

[nagios@myucbdnagiapp01 libexec]$ ./check_nrpe_v321r_rhel7 -H localhost -c "rs_GetOSVersion" -a "linux"
NRPE: Command 'rs_GetOSVersion!linux' not defined

This is using 3.2.1r nrpe agent in RHEL8, it is working fine.
[nagios@myucbdnagiapp01 libexec]$ ./check_nrpe_v321r_rhel7 -H localhost -c "rs_GetOSVersion"
Red Hat Enterprise Linux release 8.2 (Ootpa) x86_64 [myucbdnagiapp01] *NRPE v3.2.1*

[nagios@myucbdnagiapp01 libexec]$ ./check_nrpe_v321r_rhel7 -H localhost -c "rs_GetOSVersion" -a linux
Red Hat Enterprise Linux release 8.2 (Ootpa) x86_64 [myucbdnagiapp01] *NRPE v3.2.1*
Here is the nrpe.cfg file
#############################################################################
#
# NRPE Config File V3.0.1
#############################################################################


log_facility=daemon
log_file=/usr/local/nagios/nrpe.log
debug=0
pid_file=/usr/local/nagios/var/nrpe.pid
server_port=5666
#listen_queue_size=5
nrpe_user=nagios
nrpe_group=nagios

allowed_hosts=127.0.0.1,::1

dont_blame_nrpe=1
allow_bash_command_substitution=0
command_timeout=60
connection_timeout=300

command[rs_GetOSVersion]=/usr/local/nagios/libexec/rs_GetOSVersion $ARG1$

Re: Strange nrpe 4.0.3 problem

Posted: Mon Feb 08, 2021 5:09 pm
by ssax
This usually occurs when you don't enable arguments during the compile of NRPE.

Did you install through this utility (it should do it for you)?

https://assets.nagios.com/downloads/nag ... _Agent.pdf

Or if you compiled from source, you'll need to do this:

Code: Select all

cd /tmp/nrpe-nrpe-4.0.3/
./configure --enable-command-args
make all
Taken from here:

https://support.nagios.com/kb/article.php?id=515#RHEL

Re: Strange nrpe 4.0.3 problem

Posted: Mon Feb 08, 2021 8:15 pm
by rajasegar
ssax wrote:This usually occurs when you don't enable arguments during the compile of NRPE.

Did you install through this utility (it should do it for you)?

https://assets.nagios.com/downloads/nag ... _Agent.pdf

Or if you compiled from source, you'll need to do this:

Code: Select all

cd /tmp/nrpe-nrpe-4.0.3/
./configure --enable-command-args
make all
Taken from here:

https://support.nagios.com/kb/article.php?id=515#RHEL
Thanks. No wonder. You can close the thread.

Re: Strange nrpe 4.0.3 problem

Posted: Tue Feb 09, 2021 4:01 pm
by benjaminsmith
Hi @rajasegar,

Thanks for the update and glad it's working for you now.

Benjamin