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

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.
Post Reply
pnikhade
Posts: 4
Joined: Thu Jul 27, 2023 10:23 am

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

Post by pnikhade »

Hi All,

I had installed Nagios core on EC2 instance and when trying to check load on the remote server, I am getting the below response by executing the command,

./check_nrpe -H 13.201.39.252 -c check_load -a -w .15,.10,.05 -c .30,.25,.20
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).

I read somewhere to run --enable-command-args with ./configure but still not working. Any ideas so as to resolve this ?

Thanks,
Piyush Nikhade
User avatar
danderson
Posts: 113
Joined: Wed Aug 09, 2023 10:05 am

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

Post by danderson »

Thanks for reaching out @pnikhade,

I found this article especially helpful
https://assets.nagios.com/downloads/nag ... e/NRPE.pdf

I was able to replicate your issue and resolve it. You have two options.

Enable Command Line Arguments
Open up /usr/local/nagios/etc/nrpe.cfg or wherever the nrpe configuration is on the remote server you are trying to check
Go to the commands section. You'll see a line like so

Code: Select all

command[check_load]=/usr/local/nagios/libexec/check_load -r -w .15,.10,.05 -c .30,.25,.20
Change this to

Code: Select all

command[check_load]=/usr/local/nagios/libexec/check_load $ARG1$
Then, go to a line that looks like so

Code: Select all

dont_blame_nrpe=0
Change it to

Code: Select all

dont_blame_nrpe=1
Restart the nrpe service and try again.

The main issue with this is that it is inherintely insecure because any plugin can effectively control the shell. This is why it's recommended to

Alter the Command In the Configuration File
Instead of changing the check_load command to include $ARG1$, simply update the command line arguments in the config file to be what you want

Code: Select all

command[check_load]=/usr/local/nagios/libexec/check_load -w .15,.10,.05 -c .30,.25,.20
In this case you won't have to edit anything, and the check command would now be

Code: Select all

./check_nrpe -H 13.201.39.252 -c check_load
Let me know if you need any more help
Post Reply