Page 1 of 1

CHECK_NRPE: Receive header underflow

Posted: Mon Jun 17, 2019 5:52 am
by RIDS_I2MP
Hello Team,

We have one AIX server whcih we have been monitoring from a long time, all he services were monitored properly through our Nagios XI.

Not sure why, the services went into UNKNOWN status and we are getting below error for all of them:

CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).

[nagios@eu2napu003 ~]$ /usr/local/nagios/libexec/check_nrpe -H 10.147.109.107
NRPE v2.12
[nagios@eu2napu003 ~]$
[nagios@eu2napu003 ~]$ /usr/local/nagios/libexec/check_nrpe -V
NRPE Plugin for Nagios
Version: 3.2.1
[nagios@eu2napu003 ~]$

eu2napu003 - Nagios XI server
Remote host: 10.147.109.107

Please check and help us to resolve this issue.

Re: CHECK_NRPE: Receive header underflow

Posted: Mon Jun 17, 2019 10:23 am
by benjaminsmith
Hello @RIDS_I2MP,

Did you make any changes to either the XI server or AIX server recently?

Please run of those those checks from the command line on the Nagios XI server, however, use the -2 option for version 2 packets, and post the output to the thread.

For example,

Code: Select all

/usr/local/nagios/libexec/check_nrpe -2 -H remote-host check_command
Reference:
Nagios XI - How To Test Check Commands From The Command-line

Re: CHECK_NRPE: Receive header underflow

Posted: Mon Jun 17, 2019 11:47 pm
by RIDS_I2MP
Hello,

I have ran test check from command line and getting the same output for all of them.

[nagios@eu2napu003 ~]$ /usr/local/nagios/libexec/check_nrpe -2 -H 10.147.109.107 check_disk
NRPE v2.12
[nagios@eu2napu003 ~]$ ^C
[nagios@eu2napu003 ~]$ /usr/local/nagios/libexec/check_nrpe -H 10.147.109.107 check_disk
NRPE v2.12
[nagios@eu2napu003 ~]$
[nagios@eu2napu003 ~]$ /usr/local/nagios/libexec/check_nrpe -2 -H 10.147.109.107 check_services
NRPE v2.12
[nagios@eu2napu003 ~]$
[nagios@eu2napu003 ~]$ /usr/local/nagios/libexec/check_nrpe -2 -H 10.147.109.107 check_cpu_custom
NRPE v2.12
[nagios@eu2napu003 ~]$


There was a failover activity on last weekend in which this server was also present, we are not sure if any changes were made.

Re: CHECK_NRPE: Receive header underflow

Posted: Tue Jun 18, 2019 9:31 am
by lmiltchev
Actually, the correct syntax is to use "-c" to pass the command, e.g.:

Code: Select all

./check_nrpe -H <client ip> -c <command>
so try:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -2 -H 10.147.109.107 -c check_disk
/usr/local/nagios/libexec/check_nrpe -2 -H 10.147.109.107 -c check_services
/usr/local/nagios/libexec/check_nrpe -2 -H 10.147.109.107 -c check_cpu_custom

Re: CHECK_NRPE: Receive header underflow

Posted: Tue Jun 18, 2019 10:51 pm
by RIDS_I2MP
Hello,

[nagios@eu2napu003 libexec]$ /usr/local/nagios/libexec/check_nrpe -2 -H 10.147.109.107 -c check_cpu_custom
CPU OK - 112.3% CPU out of entitlement|cpu_ent=112%;;;0;300
[nagios@eu2napu003 libexec]$
[nagios@eu2napu003 libexec]$
[nagios@eu2napu003 libexec]$ /usr/local/nagios/libexec/check_nrpe -2 -H 10.147.109.107 -c check_disk -a '-w 15% -c 10% -p /home'
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).
[nagios@eu2napu003 libexec]$
[nagios@eu2napu003 libexec]$
[nagios@eu2napu003 libexec]$ /usr/local/nagios/libexec/check_nrpe -2 -H 10.147.109.107 -c check_disk -a '-w 13% -c 5% -p /u02'
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).
[nagios@eu2napu003 libexec]$
[nagios@eu2napu003 libexec]$
[nagios@eu2napu003 libexec]$ /usr/local/nagios/libexec/check_nrpe -2 -H 10.147.109.107 -c check_services -a 'syslogd'
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).
[nagios@eu2napu003 libexec]$

Re: CHECK_NRPE: Receive header underflow

Posted: Wed Jun 19, 2019 8:59 am
by lmiltchev
The problem seems to be with passing arguments. When you installed NRPE on the client, did you enable command arguments?

Example:

Code: Select all

./configure --enable-command-args
Even if you set up:

Code: Select all

dont_blame_nrpe=1
in the nrpe.cfg, passing arguments would not work, unless you compiled the agent with --enable-command-args.

Re: CHECK_NRPE: Receive header underflow

Posted: Wed Jun 19, 2019 10:41 pm
by RIDS_I2MP
Hello,

We have set the below value in nrpe.cfg file:

dont_blame_nrpe=1

But, did not enable the below:

./configure --enable-command-args

Please let me know what am I supposed to do now?

Re: CHECK_NRPE: Receive header underflow

Posted: Thu Jun 20, 2019 6:42 am
by scottwilkerson
RIDS_I2MP wrote:But, did not enable the below:

./configure --enable-command-args
You would then need to re-compile NRPE from source with that configure flag

Re: CHECK_NRPE: Receive header underflow

Posted: Thu Jun 20, 2019 10:30 pm
by RIDS_I2MP
Hello,

I tried running that but getting below error:

NON-PROD> [email protected]: /usr/local/nagios/etc > ./configure --enable-command-args
ksh: ./configure: not found.
NON-PROD> [email protected]: /usr/local/nagios/etc >

Re: CHECK_NRPE: Receive header underflow

Posted: Fri Jun 21, 2019 6:34 am
by scottwilkerson
You need to download the package and be in that directory when you run it

https://support.nagios.com/kb/article.php?id=8