CHECK_NRPE: Receive header underflow - only 0 bytes received

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
nagmoto
Posts: 195
Joined: Fri Jan 09, 2015 8:05 am

CHECK_NRPE: Receive header underflow - only 0 bytes received

Post by nagmoto »

I am using github issue to record my issue.
Please see details at https://github.com/NagiosEnterprises/nrpe/issues/218
let me know if you need more info.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: CHECK_NRPE: Receive header underflow - only 0 bytes rece

Post by benjaminsmith »

Hello @nagmoto,


I believe you are hitting this issue and need to compile NRPE with enable command arguments.

https://github.com/NagiosEnterprises/nrpe/issues/92

See: NRPE - How To Install NRPE v3 From Source

Code: Select all

cd /tmp/nrpe-nrpe-3.2.1/
./configure --enable-command-args
make all
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
nagmoto
Posts: 195
Joined: Fri Jan 09, 2015 8:05 am

Re: CHECK_NRPE: Receive header underflow - only 0 bytes rece

Post by nagmoto »

I am using stock nrpe-3.2.1-8 rpm for centos 7.
the src.rpm was downloaded to see if EPEL missed the " --enable-command-args" ?
But it does have this argument in configure script.

<snipped from nagios.spec>
%build
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" LDFLAGS="%{?__global_ldflags}" \
%configure \
--with-init-dir=%{_initrddir} \
--with-nrpe-port=%{nsport} \
--with-nrpe-user=nrpe \
--with-nrpe-group=nrpe \
--with-piddir=/var/run/nrpe \
--bindir=%{_sbindir} \
--libdir=/doesnt/matter/ \
--libexecdir=%{_libdir}/nagios/plugins \
--datadir=%{_datadir}/nagios \
--sysconfdir=%{_sysconfdir}/nagios \
--localstatedir=%{_localstatedir}/run/ \
--enable-command-args
<snipped>

Also following showing check_nrpe is able to accept arguments from check_time test.

Code: Select all

[pi@nagios4 src]$ ./check_nrpe -H localhost -2 -4  -c check_logfiles_4A -a "/var/log/nagios/nagios.log" "nagios-log" ".*] Error:.*" ".*NOERROR.*"
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).
[pi@nagios4 src]$ check_nrpe -H localhost   -c check_time -a localhost 1 2
OK - timedrift=0 seconds | timedrift=0s;1;2
[pi@nagios4 src]$

benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: CHECK_NRPE: Receive header underflow - only 0 bytes rece

Post by benjaminsmith »

Hello @nagmoto,

Hope you had a great weekend. Make sure you have the configuration file set to receive arguments.

Code: Select all

dont_blame_nrpe=1
If your not sure, you can post the nrpe.cfg file from the remote host to the thread.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
nagmoto
Posts: 195
Joined: Fri Jan 09, 2015 8:05 am

Re: CHECK_NRPE: Receive header underflow - only 0 bytes rece

Post by nagmoto »

Hi

Please see the checking of "don't blame" setting at https://github.com/NagiosEnterprises/nrpe/issues/218
I also compile nrpe and check_nrpe from the instruction, to replace binaries from nrpe centos packages. Result is the same.

"check_nrpe -H localhost -c check_time -a localhost 1 2" command is working as expected.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: CHECK_NRPE: Receive header underflow - only 0 bytes rece

Post by benjaminsmith »

Hello @nagmoto

We did a few different tests and the results are that we can run your version directly from the command line but there's an issue with escaping your regex expression. For example, the following version work:

Code: Select all

./check_nrpe -H 192.168.18.151 -c check_logfiles_4A -a /usr/local/nagios/var/nagios.log nagios-log .*[^]] Error.* .*NOERROR.*
One option is to hard code the matching argument, nagios-log" ".*] Error:.*, in the command definition or possible modify the expression as we had difficulty escaping the [ bracket.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
nagmoto
Posts: 195
Joined: Fri Jan 09, 2015 8:05 am

Re: CHECK_NRPE: Receive header underflow - only 0 bytes rece

Post by nagmoto »

Thanks for the great pointer for R.E. argument passing issue. I am able to use the walk around to do the logfile checking.
Can this issue be classified as bug and fix it in future NRPE release ?
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: CHECK_NRPE: Receive header underflow - only 0 bytes rece

Post by benjaminsmith »

Hello @nagmoto,

Happy to hear you got the logfile check working. We did q number of tests until we found the particular regex character that was causing the error.

As far as if this is a bug or not with NRPE, would you be able update the GitHib issue you posted for a developer to review?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
nagmoto
Posts: 195
Joined: Fri Jan 09, 2015 8:05 am

Re: CHECK_NRPE: Receive header underflow - only 0 bytes rece

Post by nagmoto »

Thanks for you reply again. Please close this ticket.
I will update github issue with more detail for developer to review.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: CHECK_NRPE: Receive header underflow - only 0 bytes rece

Post by benjaminsmith »

Hello @nagmoto,
I will update github issue with more detail for developer to review
Much appreciated.

I'll mark this as resolved. Please feel free to open anther post if you have any new questions.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked