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
Yooshi
Posts: 6
Joined: Sun Nov 18, 2018 10:21 am

CHECK_NRPE: Receive header underflow - only 0 bytes received

Post by Yooshi »

Hello,

I've some difficult to use the NRPE plugin with nagios for monitor a windows server.

I've use this to install my NagiosCore/NagiosPlugins/NRPE :

Code: Select all

dpkg -l selinux*
apt-get update
apt-get install -y autoconf automake gcc libc6 libmcrypt-dev make libssl-dev wget unzip apache2 apache2-utils php libgd-dev bc gawk dc build-essential snmp libnet-snmp-perl gettext
cd /tmp
wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.4.2.tar.gz
tar xzf nagioscore.tar.gz
cd /tmp/nagioscore-nagios-4.4.2/
./configure --with-httpd-conf=/etc/apache2/sites-enabled
make all
make install-groups-users
usermod -a -G nagios www-data
make install
make install-daemoninit
make install-commandmode
make install-config
make install-webconf
a2enmod rewrite
a2enmod cgi
iptables -I INPUT -p tcp --destination-port 80 -j ACCEPT
iptables -I INPUT -p tcp --destination-port 5666 -j ACCEPT
apt-get install -y iptables-persistent
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
systemctl restart apache2.service
systemctl start nagios.service
cd /tmp
wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugins/nagios-plugins/archive/release-2.2.1.tar.gz
tar zxf nagios-plugins.tar.gz
cd /tmp/nagios-plugins-release-2.2.1/
./tools/setup
./configure
make
make install
cd /tmp
wget --no-check-certificate -O nrpe.tar.gz https://github.com/NagiosEnterprises/nrpe/archive/nrpe-3.2.1.tar.gz
tar xzf nrpe.tar.gz
cd /tmp/nrpe-nrpe-3.2.1/
./configure --enable-command-args --disable-ssl
make all
make install-groups-users
make install
make install-config
echo >> /etc/services
echo '# Nagios services' >> /etc/services
echo 'nrpe    5666/tcp' >> /etc/services
make install-init
systemctl enable nrpe.service
sed -i '/^allowed_hosts=/s/$/,10.205.134.126,10.205.128.95/' /usr/local/nagios/etc/nrpe.cfg
sed -i 's/^dont_blame_nrpe=.*/dont_blame_nrpe=1/g' /usr/local/nagios/etc/nrpe.cfg
systemctl start nrpe.service
On my windows server, I've install NSClient++ (0.5.2.35 and 0.4.4.23 x64) and I installed it with the insecure legacy mode active and a blank password.

On my nagios server, when i run this command :

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
I've a correct answer : NRPE v3.2.1

But when i try with my windows server :

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 10.205.134.126
I've this : CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).

I've already look a lot of topics but none can help me :(

You can find my nsclient.ini in attachment.

Thanks for ur help !
Attachments
nsclient.ini
(926 Bytes) Downloaded 266 times
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

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

Post by tgriep »

The nsclient.ini file is missing some needed entries and that is causing the connection issue.
I attached a generic ini file to the post you can use to replace your copy with.
You will need to edit it and change the "allowed hosts" option and add the Nagios server's IP address to the list.
Make sure inbound port 5666 is allowed in on the Windows Firewall.
Save the file and restart NSClient++ on the Windows system and test it from the Nagios server.
If it fails, check the nsclient.log file on the Windows server for any errors and post them here.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Yooshi
Posts: 6
Joined: Sun Nov 18, 2018 10:21 am

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

Post by Yooshi »

Thanks for your help !

I will test that but i can't see your attachment ??
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

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

Post by tgriep »

I probably missed the upload so here it is again.
Attachments
nsclient.ini
(1.9 KiB) Downloaded 285 times
Be sure to check out our Knowledgebase for helpful articles and solutions!
Yooshi
Posts: 6
Joined: Sun Nov 18, 2018 10:21 am

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

Post by Yooshi »

Its working !!! Thanks a lot tgriep for ur help !

First try doesn't work cause i've installed my NRPE on my Nagios with :

Code: Select all

--disable-ssl
But i've modify nsclient.ini and change this :

Code: Select all

use ssl = 1
to

Code: Select all

use ssl = 0
Now its working perfectly :

Code: Select all

root@nagios:/home/nagios# /usr/local/nagios/libexec/check_nrpe -H 10.205.128.95
I (0.5.2.35 2018-01-28) seem to be doing fine...
Thanks again for ur help !!
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

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

Post by tgriep »

Your very welcome. Glad it is working now. I'll close and mark the post for you but feel free to open a new post in the future for any new questions you may have.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked