check_nrpe: Receive header underflow - only 0 bytes receive

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mbeebe
Posts: 144
Joined: Thu Dec 20, 2018 5:12 pm

check_nrpe: Receive header underflow - only 0 bytes receive

Post by mbeebe »

Hello again,

For my sins, I have been asked to perform a simple task: monitor a process on a remote server.

No problem! Nagios provides a handy-dandy plugin called check_procs, which should do the trick and be amazingly easy to install and configure.

So I do the following:

>yum --enablerepo=epel -y install nrpe nagios-plugins
(nb: this is on RHEL 7.x and I had just installed the latest EPEL repo on this box)

But wait -- we're missing both check_nrpe AND check_proc. I can fix this easy-peasy!

>install nagios-plugins-procs
>install nagios-plugins-nrpe
>systemctl enable nrpe
>systemctl start nrpe
>ps -ef | grep nrpe

nrpe 7024 1 0 07:56 ? 00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f

Hooray, I'm up and running! Certainly, this is going to be a wonderful day that will in no way be marred by technical difficulties that will leave me slamming my head against my desk for three hours and praying to catch CV-19 just to end my suffering.

>./check_nrpe -H localhost
NRPE v4.0.2

Close! So close! Now, we just need to test it all out:

>./check_nrpe -H localhost -c check_proc -a 'procname'
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected)

AAAAAAAAAAAAAAAHHHHHHHHHH!!!!!!

Ok, don't panic, I can handle this; Google is your friend.
(Google, Google, Google, AH-HA!)

Oh, it's some SSL nonsense, because obviously just having things work would take the fun out of life. Alrighty, all I need to do is add a "-n" to the command line and check_nrpe will bypass the SSL check:

>./check_nrpe -H localhost -n -c check_proc -a 'procname'
CHECK_NRPE: Receive header underflow - only -1 bytes received (4 expected).

AAAAAAAAAAAAAAAHHHHHHHHHH!!!!!!

Having now been at this for three irreplaceable hours of my life, and upon answering the fourth email today from my boss asking if this simple task is complete, I come to you a-begging: oh great Masters of Nagios, whyfor doesn't this #$@#$@#!!!ing thing work?

Thank you,

-- Mike Beebe
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: check_nrpe: Receive header underflow - only 0 bytes rec

Post by tgriep »

Nagios does not provide binary or RPM packages and do not maintain the package from the EPEL site.

I suggest removing it and follow this document for installing the NRPE agent provided by Nagios.

Here are the instructions.
https://assets.nagios.com/downloads/nag ... _Agent.pdf
Here is the download package.

Code: Select all

https://assets.nagios.com/downloads/nagiosxi/agents/linux-nrpe-agent.tar.gz
Typically, that error means that the NRPE agent is not setup to allow arguments.
Look at the /etc/nagios/nrpe.cfg file and see if the following option is set to the following

Code: Select all

dont_blame_nrpe=1
If not, set it to a 1 and restart NRPE.
If it still fails, then the agent may not of been compiled to accept arguments.
Also, the commands in the EPEL package, are probably hard coded to not use arguments so you will have to edit them use use arguments.

That is why you should use the Nagios installer, it is setup to use arguments and the commands are setup to function with XI.
Be sure to check out our Knowledgebase for helpful articles and solutions!
mbeebe
Posts: 144
Joined: Thu Dec 20, 2018 5:12 pm

Re: check_nrpe: Receive header underflow - only 0 bytes rec

Post by mbeebe »

Thank you -- please close this thread.

-- Mike Beebe
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_nrpe: Receive header underflow - only 0 bytes rec

Post by scottwilkerson »

mbeebe wrote:Thank you -- please close this thread.

-- Mike Beebe
Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked