CHECK_NRPE: Receive header underflow - only 0 bytes received

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

CHECK_NRPE: Receive header underflow - only 0 bytes received

Postby cocoyanouck » Wed Apr 18, 2018 9:32 am

Hello everybody and sorry for my bad english language.

I just have configured a new Nagios server 4.3.4 on debian 9.
I need to use check_nrpe on this server to a Windows remote server 2012 R2 which is not on the same network. But for information "ping" is OK in both ways. I have setted up nsclient++ 0.5.1 such as all my others servers.

On my nagios server, I have installed NRPE 3.1.1 but I had the issue "could not complete ssl handshake" so I configure again with --disable-ssl and this problem is solved.
Code: Select all
./configure --disable-ssl then "make" and "make all"


Please find my problem on the following attachment. NRPE is OK on localhost, but I have an error when i try the IP of my remote server.

For information, I have another nagios server (configured for french country) with NRPE 3.0.1. I have no problem with this command :
Code: Select all
./check_nrpe -H 10.30.2.29
I (0.5.1.46 {...} seem to be doing fine

So I presume that there is no problem on the windows server (the client) but I miss something on my new nagios server ...

Could you help me please ?
Attachments
Capture d’écran 2018-04-18 à 16.19.30.png
cocoyanouck
 
Posts: 90
Joined: Fri Apr 08, 2016 3:17 am

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

Postby lmiltchev » Wed Apr 18, 2018 12:25 pm

When you compiled NRPE on your Debian machine, did you pass "--enable-command-args" to your "configure" command? If you haven't, recompile NRPE in order to fix the issue. For more information, please review the articles below:

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

https://support.nagios.com/kb/article.php?id=515#Debian
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!
User avatar
lmiltchev
QA Manager
 
Posts: 11081
Joined: Mon May 23, 2011 12:15 pm

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

Postby cocoyanouck » Fri Apr 20, 2018 8:16 am

Hum, your first link on github seems to be down.

This is what I did :

Code: Select all
cd /tmp
wget http://downloads.sourceforge.net/project/nagios/nrpe-3.x/nrpe-3.1.1/nrpe-3.1.1.tar.gz
tar -zxvf nrpe-3.1.1.tar.gz
cd nrpe-3.1.1
./configure --enable-command-args --disable-ssl
make all
make install-config
make install-init
systemctl enable nrpe.service
cd /usr/local/nagios/libexec/


And on nrpe.cfg I have modified like this :

allowed_hosts=127.0.0.1,10.0.0.0/24,10.30.0.0/24
dont_blame_nrpe=1

Output OK :
Code: Select all
root@nagios-vz:/usr/local/nagios/libexec# ./check_nrpe -H 127.0.0.1
NRPE v3.1.1


Output issue (but OK from another nagios server...) :
Code: Select all
root@nagios-vz:/usr/local/nagios/libexec# ./check_nrpe -H 10.30.2.29
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).


Code: Select all
PING 10.30.2.29 (10.30.2.29) 56(84) bytes of data.
64 bytes from 10.30.2.29: icmp_seq=1 ttl=125 time=178 ms
cocoyanouck
 
Posts: 90
Joined: Fri Apr 08, 2016 3:17 am

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

Postby tgriep » Fri Apr 20, 2018 3:06 pm

I would remove the NRPE agent from the system as it is an older version and reinstall the newer version by following this KB article.
https://support.nagios.com/kb/article/nrpe-how-to-install-nrpe-8.html
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!
User avatar
tgriep
Madmin
 
Posts: 7232
Joined: Thu Oct 30, 2014 9:02 am

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

Postby cocoyanouck » Mon Apr 23, 2018 2:19 am

Hello,

I launched the install script below :

cd /tmp
wget http://assets.nagios.com/downloads/nagi ... el4.tar.gz
tar xzf linux-nrpe-agent.tar.gz
cd linux-nrpe-agent
./fullinstall

I understand that now NRPE is running with xinetd service ?

So, when I run ./check_nrpe I have this :

Code: Select all
root@nagios-vz:/usr/local/nagios/libexec# ./check_nrpe -H 127.0.0.1
NRPE v3.2.1

Code: Select all
root@nagios-vz:/usr/local/nagios/libexec# ./check_nrpe -H 10.30.2.29
CHECK_NRPE: (ssl_err != 5) Error - Could not complete SSL handshake with 10.30.2.29: 1


Should I have to reinstall without the script and with the argument --disable-ssl ?
cocoyanouck
 
Posts: 90
Joined: Fri Apr 08, 2016 3:17 am

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

Postby tgriep » Mon Apr 23, 2018 11:33 am

Can you post the nsclient.ini file from the server at IP address 10.30.2.29 so we can view the settings?
Did you add the New Nagios's IP address to the allowed hosts list in the nsclient.ini file?
If not, add it and restart the NSClient++ agent to see if that fixes the issue.
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!
User avatar
tgriep
Madmin
 
Posts: 7232
Joined: Thu Oct 30, 2014 9:02 am

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

Postby cocoyanouck » Wed Apr 25, 2018 4:19 am

Nsclient.ini on 10.20.2.29 :

Ping 10.0.2.130 is OK.

Code: Select all
# If you want to fill this file with all available options run the following command:
#   nscp settings --generate --add-defaults --load-all
# If you want to activate a module and bring in all its options use:
#   nscp settings --activate-module <MODULE NAME> --add-defaults
# For details run: nscp settings --help


; TODO
[/settings/default]

; Undocumented key
password = XXXXXXX

; Undocumented key
allowed hosts = 10.0.2.130

; TIMEOUT - Timeout when reading packets on incoming sockets. If the data has not arrived within this time we will bail out.
timeout = 30

; CACHE ALLOWED HOSTS - If host names (DNS entries) should be cached, improves speed and security somewhat but won't allow you to have dynamic IPs for your Nagios server.
cache allowed hosts = 1


; TODO
[/settings/NRPE/server]

; Undocumented key
insecure = true

; Undocumented key
verify mode = none
allow arguments = true
allow nasty characters = 1
allowed host = 10.0.2.130

; EXTENDED RESPONSE - Send more then 1 return packet to allow response to go beyond payload size (requires modified client if legacy is true this defaults to false).
extended response = 0

; ENABLE SSL ENCRYPTION - This option controls if SSL should be enabled.
use ssl = 1

; PORT NUMBER - Port to use for NRPE.
port = 5666


; TODO
[/modules]

; Undocumented key
CheckExternalScripts = 1

; Undocumented key
CheckHelpers = 1

; Undocumented key
CheckNSCP = 1

; Undocumented key
CheckEventLog = 1

; Undocumented key
CheckDisk = 1

; Undocumented key
CheckSystem = 1

; Undocumented key
NSClientServer = 1

; Undocumented key
NRPEServer = 1
CheckTaskSched = 1

[/settings/external scripts]
allow nasty characters = 1
allow arguments = 1

; COMMAND TIMEOUT - The maximum time in seconds that a command can execute. (if more then this execution will be aborted). NOTICE this only affects external commands not internal ones.
timeout = 60


; A set of filters to use in real-time mode
[/settings/system/windows/real-time/checks]


; A set of options to configure the real time checks
[/settings/system/windows/real-time]


; TODO
[/settings/system/windows/counters]


; A list of wrapped scripts (ie. scruts using a template mechanism). The template used will be defined by the extension of the script.
[/settings/external scripts/wrapped scripts]


; TODO
[/settings/system/windows/counters/default]


; TODO
[/settings/log]

; LOG LEVEL - Log level to use. Available levels are error,warning,info,debug,trace
level = info

; DATEMASK - The size of the buffer to use when getting messages this affects the speed and maximum size of messages you can recieve.
date format = %Y-%m-%d %H:%M:%S

; FILENAME - The file to write log data to. Set this to none to disable log to file.
file name = ${exe-path}/nsclient.log


; TODO
[/settings/NSClient/server]

; ENABLE SSL ENCRYPTION - This option controls if SSL should be enabled.
use ssl = 0

; PERFORMANCE DATA - Send performance data back to Nagios (set this to 0 to remove all performance data).
performance data = 1

; PORT NUMBER - Port to use for check_nt.
port = 12489


; TODO
[/settings/external scripts/scripts/default]

; IGNORE PERF DATA - Do not parse performance data from the output
ignore perfdata = 0


; TODO
[/settings/system/windows]

; DEFAULT LENGTH - Used to define the default interval for range buffer checks (ie. CPU).
default buffer length = 1h


; Files to be included in the configuration
[/includes]


; TODO
[/settings/external scripts/alias/default]


; TODO
[/settings/crash]

; SUBMISSION URL - The url to submit crash reports to
submit url = https://crash.nsclient.org/post

; CRASH ARCHIVE LOCATION - The folder to archive crash dumps in
archive folder = ${crash-folder}

; RESTART - Submit crash reports to nsclient.org (or your configured submission server)
restart = true

; ARCHIVE CRASHREPORTS - Archive crash reports in the archive folder
archive = true

; RESTART SERVICE NAME - The url to submit crash reports to
restart target = NSCP


; TODO
[/settings/external scripts/alias]


; TODO
[/settings/eventlog]

; LOOKUP NAMES - Lookup the names of eventlog files
lookup names = 1

; BUFFER_SIZE - The size of the buffer to use when getting messages this affects the speed and maximum size of messages you can recieve.
buffer size = 131072

; DEBUG - Log more information when filtering (useful to detect issues with filters) not useful in production as it is a bit of a resource hog.
debug = 0


; TODO
[/settings/shared session]


; A list of scripts available to run from the CheckExternalScripts module. Syntax is: <command>=<script> <arguments>
[/settings/external scripts/scripts]


; TODO
[/paths]

; Path for module-path -
module-path = ${shared-path}/modules

; Path for certificate-path -
certificate-path = ${shared-path}/security

; Path for shared-path -
shared-path = C:\Program Files\NSClient++

; Path for exe-path -
exe-path = C:\Program Files\NSClient++

; Path for crash-folder -
crash-folder = ${shared-path}/crash-dumps

; Path for base-path -
base-path = C:\Program Files\NSClient++


; TODO
[/settings/eventlog/real-time/filters/default]

; MAGIMUM AGE - How long before reporting "ok". If this is set to "false" no periodic ok messages will be reported only errors.
maximum age = 5m

; EMPTY MESSAGE - The message to display if nothing matches the filter (generally considered the ok state).
empty message = eventlog found no records


; A set of filters to use in real-time mode
[/settings/eventlog/real-time/filters]


; Configure which services has to be in which state
[/settings/system/windows/service mapping]


; TODO
[/settings/log/file]


; TODO
[/settings/eventlog/real-time]

; REAL TIME CHECKING - Spawns a background thread which detects issues and reports them back instantly.
enabled = 0

; DEBUG - Log missed records (useful to detect issues with filters) not useful in production as it is a bit of a resource hog.
debug = 0

; STARTUP AGE - The initial age to scan when starting NSClient++
startup age = 30m

; LOGS TO CHECK - Comma separated list of logs to check
log = application,system


; TODO
[/settings/external scripts/wrappings]

; VISUAL BASIC WRAPPING -
vbs = cscript.exe //T:30 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%

; POWERSHELL WRAPPING -
ps1 = cmd /c echo If (-Not (Test-Path "scripts\%SCRIPT%") ) { Write-Host "UNKNOWN: Script `"%SCRIPT%`" not found."; exit(3) }; scripts\%SCRIPT% $ARGS$; exit($lastexitcode) | powershell.exe /noprofile -command -

; BATCH FILE WRAPPING -
bat = scripts\\%SCRIPT% %ARGS%
cocoyanouck
 
Posts: 90
Joined: Fri Apr 08, 2016 3:17 am

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

Postby tgriep » Wed Apr 25, 2018 2:48 pm

The nsclient.ini file looks like it should work.
When you installed the NSClient++ agent, did you allow port 5666 inbound through the firewall?
To check to see if the Nagios server can see if that port is open, run the following as root on the Nagios server.
Code: Select all
nmap 10.30.2.29 -p 5666
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!
User avatar
tgriep
Madmin
 
Posts: 7232
Joined: Thu Oct 30, 2014 9:02 am

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

Postby cocoyanouck » Thu Apr 26, 2018 3:42 am

Please not that we have changed the IP address of the host : 10.20.2.29 => 10.20.2.38.

root@nagios-vz:/usr/local/nagios/libexec# nmap 10.30.2.38 -p 5666

Starting Nmap 7.40 ( https://nmap.org ) at 2018-04-26 10:40 CEST
Nmap scan report for 10.30.2.38
Host is up (0.18s latency).
PORT STATE SERVICE
5666/tcp open nrpe

Nmap done: 1 IP address (1 host up) scanned in 0.45 seconds
root@nagios-vz:/usr/local/nagios/libexec# ./check_nrpe -H 10.30.2.38
CHECK_NRPE: (ssl_err != 5) Error - Could not complete SSL handshake with 10.30.2.38: 1


For information, I have tried to reinstall NRPE from source, and I have the same issue to the beginning. Please find all the code i have entered :


root@nagios-vz:/usr/local/nagios/libexec# cd /tmp/
root@nagios-vz:/tmp# wget http://downloads.sourceforge.net/projec ... 2.1.tar.gz
--2018-04-26 10:45:02-- http://downloads.sourceforge.net/projec ... 2.1.tar.gz
Résolution de downloads.sourceforge.net (downloads.sourceforge.net)… 216.105.38.13
Connexion à downloads.sourceforge.net (downloads.sourceforge.net)|216.105.38.13|:80… connecté.
requête HTTP transmise, en attente de la réponse… 302 Found
Emplacement : https://netix.dl.sourceforge.net/projec ... 2.1.tar.gz [suivant]
--2018-04-26 10:45:02-- https://netix.dl.sourceforge.net/projec ... 2.1.tar.gz
Résolution de netix.dl.sourceforge.net (netix.dl.sourceforge.net)… 87.121.121.2
Connexion à netix.dl.sourceforge.net (netix.dl.sourceforge.net)|87.121.121.2|:443… connecté.
requête HTTP transmise, en attente de la réponse… 200 OK
Taille : 518015 (506K) [application/x-gzip]
Sauvegarde en : « nrpe-3.2.1.tar.gz »

nrpe-3.2.1.tar.gz 100%[===================>] 505,87K 1,46MB/s in 0,3s

2018-04-26 10:45:03 (1,46 MB/s) — « nrpe-3.2.1.tar.gz » sauvegardé [518015/518015]

root@nagios-vz:/tmp# tar -zxvf nrpe-3.2.1.tar.gz
nrpe-3.2.1/
nrpe-3.2.1/.gitignore
nrpe-3.2.1/.travis.yml
nrpe-3.2.1/CHANGELOG.md
nrpe-3.2.1/LEGAL
nrpe-3.2.1/LICENSE.md
nrpe-3.2.1/Makefile.in
nrpe-3.2.1/README.SSL.md
nrpe-3.2.1/README.md
nrpe-3.2.1/SECURITY.md
nrpe-3.2.1/THANKS
nrpe-3.2.1/aclocal.m4
nrpe-3.2.1/build-aux/
nrpe-3.2.1/build-aux/config.guess
nrpe-3.2.1/build-aux/config.sub
nrpe-3.2.1/build-aux/custom_help.m4
nrpe-3.2.1/build-aux/install-sh
nrpe-3.2.1/configure
nrpe-3.2.1/configure.ac
nrpe-3.2.1/contrib/
nrpe-3.2.1/contrib/README.nrpe_check_control
nrpe-3.2.1/contrib/nrpe_check_control.c
nrpe-3.2.1/docs/
nrpe-3.2.1/docs/NRPE.odt
nrpe-3.2.1/docs/NRPE.pdf
nrpe-3.2.1/include/
nrpe-3.2.1/include/acl.h
nrpe-3.2.1/include/common.h.in
nrpe-3.2.1/include/config.h.in
nrpe-3.2.1/include/nrpe.h
nrpe-3.2.1/include/utils.h
nrpe-3.2.1/macros/
nrpe-3.2.1/macros/.gitignore
nrpe-3.2.1/macros/CHANGELOG.md
nrpe-3.2.1/macros/LICENSE
nrpe-3.2.1/macros/LICENSE.md
nrpe-3.2.1/macros/README.md
nrpe-3.2.1/macros/add_group_user
nrpe-3.2.1/macros/ax_nagios_get_distrib
nrpe-3.2.1/macros/ax_nagios_get_files
nrpe-3.2.1/macros/ax_nagios_get_inetd
nrpe-3.2.1/macros/ax_nagios_get_init
nrpe-3.2.1/macros/ax_nagios_get_os
nrpe-3.2.1/macros/ax_nagios_get_paths
nrpe-3.2.1/macros/ax_nagios_get_ssl
nrpe-3.2.1/nrpe.spec.in
nrpe-3.2.1/paths.in
nrpe-3.2.1/sample-config/
nrpe-3.2.1/sample-config/nrpe.cfg.in
nrpe-3.2.1/src/
nrpe-3.2.1/src/Makefile.in
nrpe-3.2.1/src/acl.c
nrpe-3.2.1/src/check_nrpe.c
nrpe-3.2.1/src/nrpe.c
nrpe-3.2.1/src/snprintf.c
nrpe-3.2.1/src/utils.c
nrpe-3.2.1/startup/
nrpe-3.2.1/startup/bsd-init.in
nrpe-3.2.1/startup/debian-init.in
nrpe-3.2.1/startup/default-inetd.in
nrpe-3.2.1/startup/default-init.in
nrpe-3.2.1/startup/default-service.in
nrpe-3.2.1/startup/default-socket-svc.in
nrpe-3.2.1/startup/default-socket.in
nrpe-3.2.1/startup/default-xinetd.in
nrpe-3.2.1/startup/gentoo-init.in
nrpe-3.2.1/startup/mac-inetd.plist.in
nrpe-3.2.1/startup/mac-init.plist.in
nrpe-3.2.1/startup/newbsd-init.in
nrpe-3.2.1/startup/openbsd-init.in
nrpe-3.2.1/startup/openrc-conf.in
nrpe-3.2.1/startup/openrc-init.in
nrpe-3.2.1/startup/rh-upstart-init.in
nrpe-3.2.1/startup/solaris-inetd.xml.in
nrpe-3.2.1/startup/solaris-init.xml.in
nrpe-3.2.1/startup/tmpfile.conf.in
nrpe-3.2.1/startup/upstart-init.in
nrpe-3.2.1/test-wrapper
nrpe-3.2.1/travis-test-1
nrpe-3.2.1/uninstall.in
nrpe-3.2.1/update-cfg.pl
nrpe-3.2.1/update-version
root@nagios-vz:/tmp# cd nrpe-3.2.1
root@nagios-vz:/tmp/nrpe-3.2.1# ./configure --enable-command-args --disable-ssl
checking for a BSD-compatible install... /usr/bin/install -c
checking what the operating system is ... linux
checking what the distribution type is ... debian
checking what init system is being used ... systemd
checking what inetd is being used ... xinetd
checking for which paths to use ... default
checking for which init file to use ... default-service
checking for which inetd files to use ... default-xinetd
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether make sets $(MAKE)... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking whether time.h and sys/time.h may both be included... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking dirent.h usability... yes
checking dirent.h presence... yes
checking for dirent.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking grp.h usability... yes
checking grp.h presence... yes
checking for grp.h... yes
checking for inttypes.h... (cached) yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking for stdint.h... (cached) yes
checking for strings.h... (cached) yes
checking for string.h... (cached) yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking tcpd.h usability... no
checking tcpd.h presence... no
checking for tcpd.h... no
checking for unistd.h... (cached) yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking socket.h usability... no
checking socket.h presence... no
checking for socket.h... no
checking for sys/types.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking for sys/wait.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking for sys/stat.h... (cached) yes
checking paths.h usability... yes
checking paths.h presence... yes
checking for paths.h... yes
checking for an ANSI C-conforming const... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for mode_t... yes
checking for pid_t... yes
checking for size_t... yes
checking return type of signal handlers... void
checking for uid_t in sys/types.h... yes
checking type of array argument to getgroups... gid_t
checking size of int... 4
checking size of short... 2
checking size of long... 4
checking for uint32_t... yes
checking for u_int32_t... yes
checking for int32_t... yes
checking for struct sockaddr_storage... yes
checking for seteuid... yes
checking for va_copy... yes
checking for vsnprintf... yes
checking for snprintf... yes
checking for asprintf... yes
checking for vasprintf... yes
checking for C99 vsnprintf... yes
checking for getopt_long... yes
checking for main in -lnsl... yes
checking for socket in -lsocket... no
checking for main in -lwrap... no
checking for strdup... yes
checking for strstr... yes
checking for strtoul... yes
checking for strtok_r... yes
checking for initgroups... yes
checking for closesocket... no
checking for sigaction... yes
checking for scandir... yes
checking for socklen_t... yes
checking for type of socket size... size_t
checking for perl... /usr/bin/perl
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating nrpe.spec
config.status: creating uninstall
config.status: creating sample-config/nrpe.cfg
config.status: creating startup/bsd-init
config.status: creating startup/debian-init
config.status: creating startup/default-init
config.status: creating startup/default-inetd
config.status: creating startup/default-service
config.status: creating startup/default-socket
config.status: creating startup/default-socket-svc
config.status: creating startup/default-xinetd
config.status: creating startup/mac-init.plist
config.status: creating startup/mac-inetd.plist
config.status: creating startup/newbsd-init
config.status: creating startup/openbsd-init
config.status: creating startup/openrc-conf
config.status: creating startup/openrc-init
config.status: creating startup/solaris-init.xml
config.status: creating startup/solaris-inetd.xml
config.status: creating startup/tmpfile.conf
config.status: creating startup/upstart-init
config.status: creating startup/rh-upstart-init
config.status: creating include/common.h
config.status: creating include/config.h


*** Configuration summary for nrpe 3.2.1 2017-09-01 ***:

General Options:
-------------------------
NRPE port: 5666
NRPE user: nagios
NRPE group: nagios
Nagios user: nagios
Nagios group: nagios


Review the options above for accuracy. If they look okay,
type 'make all' to compile the NRPE daemon and client
or type 'make' to get a list of make options.

root@nagios-vz:/tmp/nrpe-3.2.1# make all
cd ./src/; make
make[1] : on entre dans le répertoire « /tmp/nrpe-3.2.1/src »
gcc -g -O2 -DHAVE_CONFIG_H -I ../include -I ./../include -o nrpe ./nrpe.c ./utils.c ./acl.c -lnsl
gcc -g -O2 -DHAVE_CONFIG_H -I ../include -I ./../include -o check_nrpe ./check_nrpe.c ./utils.c -lnsl
make[1] : on quitte le répertoire « /tmp/nrpe-3.2.1/src »

*** Compile finished ***

You can now continue with the installation or upgrade process.

Read the PDF documentation (docs/NRPE.pdf) for information on the next
steps you should take to complete the installation or upgrade.

root@nagios-vz:/tmp/nrpe-3.2.1# make install
cd ./src/; make install
make[1] : on entre dans le répertoire « /tmp/nrpe-3.2.1/src »
make install-plugin
make[2] : on entre dans le répertoire « /tmp/nrpe-3.2.1/src »
/usr/bin/install -c -m 755 -d /usr/local/nagios/bin
/usr/bin/install -c -m 755 ../uninstall /usr/local/nagios/bin/nrpe-uninstall
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/libexec
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/libexec
/usr/bin/install -c -m 775 -o nagios -g nagios check_nrpe /usr/local/nagios/libexec
make[2] : on quitte le répertoire « /tmp/nrpe-3.2.1/src »
make install-daemon
make[2] : on entre dans le répertoire « /tmp/nrpe-3.2.1/src »
/usr/bin/install -c -m 755 -d /usr/local/nagios/bin
/usr/bin/install -c -m 755 ../uninstall /usr/local/nagios/bin/nrpe-uninstall
/usr/bin/install -c -m 755 nrpe /usr/local/nagios/bin
/usr/bin/install -c -m 755 -d /usr/lib/tmpfiles.d
/usr/bin/install -c -m 644 ../startup/tmpfile.conf /usr/lib/tmpfiles.d/nrpe.conf
make[2] : on quitte le répertoire « /tmp/nrpe-3.2.1/src »
make[1] : on quitte le répertoire « /tmp/nrpe-3.2.1/src »
root@nagios-vz:/tmp/nrpe-3.2.1# make install-config
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/etc
/usr/bin/install -c -m 644 -o nagios -g nagios sample-config/nrpe.cfg /usr/local/nagios/etc
root@nagios-vz:/tmp/nrpe-3.2.1# make install-init
/usr/bin/install -c -m 644 startup/default-service /lib/systemd/system/nrpe.service
root@nagios-vz:/tmp/nrpe-3.2.1# systemctl enable nrpe.service
root@nagios-vz:/tmp/nrpe-3.2.1# vi /usr/local/nagios/etc/nrpe.cfg
Modif allowed host and don't blame ...
root@nagios-vz:/tmp/nrpe-3.2.1# service nrpe start
root@nagios-vz:/tmp/nrpe-3.2.1# cd /usr/local/nagios/libexec/
root@nagios-vz:/usr/local/nagios/libexec# ./check_nrpe -H 10.30.2.38
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).
root@nagios-vz:/usr/local/nagios/libexec#
cocoyanouck
 
Posts: 90
Joined: Fri Apr 08, 2016 3:17 am

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

Postby tgriep » Thu Apr 26, 2018 8:47 am

OK, here is what is happening, you are compiling the check_nrpe plugin without SSL enabled and the settings in the nsclient.ini file is looking for SSL connections.
In the NRPE agent and plugin, you have the capability to disable using SSL with a command line option.
If you add the -n option to the check, it will not use SSL.
So, recompile the NRPE agent and plugin and leave SSL enabled.
Then if you need to connect to a remote system without SSL, you would just add the -n option to the command.
Try that out and see if that fixes the issue.
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!
User avatar
tgriep
Madmin
 
Posts: 7232
Joined: Thu Oct 30, 2014 9:02 am

Next

Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 24 guests