Page 1 of 1

CHECK_NRPE: Receive header underflow - only 0 bytes received

Posted: Fri Nov 01, 2019 7:16 am
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.

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

Posted: Fri Nov 01, 2019 9:18 am
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

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

Posted: Fri Nov 01, 2019 3:11 pm
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]$


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

Posted: Mon Nov 04, 2019 12:28 pm
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.

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

Posted: Tue Nov 05, 2019 6:11 am
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.

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

Posted: Tue Nov 05, 2019 12:46 pm
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.

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

Posted: Wed Nov 06, 2019 2:38 pm
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 ?

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

Posted: Wed Nov 06, 2019 2:46 pm
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?

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

Posted: Wed Nov 06, 2019 4:50 pm
by nagmoto
Thanks for you reply again. Please close this ticket.
I will update github issue with more detail for developer to review.

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

Posted: Wed Nov 06, 2019 4:53 pm
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.