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.
raydx
Posts: 34
Joined: Thu Jun 28, 2018 3:51 pm

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

Post by raydx »

Attached shows output from requested commands. Thanks!
Attachments
Nagios_issue.docx
(549.32 KiB) Downloaded 167 times
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

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

Post by lmiltchev »

I asked you to change the path to the check_nrpe plugin if needed, if it is different on your system... How did you install NRPE? Do you know where is check_nrpe located on your system? Let's try to find it - run the following command and post the output:

Code: Select all

find / -name *nrpe
One you locate check_nrpe, run:

Code: Select all

/path/to/check_nrpe -H <windows server ip>
/path/to/check_nrpe -H <windows server ip> -p 5666 -c CheckMem -a MaxWarn=80% MaxCrit=90% ShowAll type=physical
and show the output.
Be sure to check out our Knowledgebase for helpful articles and solutions!
raydx
Posts: 34
Joined: Thu Jun 28, 2018 3:51 pm

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

Post by raydx »

I did a sanity check and ran:
sudo apt-get install nagios-nrpe-plugin

The plug-in did install - no message about the plugin already installed.

However, I'm still getting check_nrpe: command not found after running /path/to/check_nrpe -H <windows server ip>

The plug-in is in /usr/local/nagios/libexec and /usr/lib/nagios/plugins/check_nrpe
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

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

Post by lmiltchev »

You probably didn't have to install NRPE from a repo. Now you have check_nrpe in two different locations. You don't need two plugins...

Note: Your command didn't work because you didn't run it as I asked you to... I asked you to run:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <windows server ip>
You CD-ed to libexec directory instead and ran:

Code: Select all

check_nrpe -H 10.11.96.194
That's why you got the "check_nrpe: command not found" message. Since you were already inside the libexec directory, you should've run:

Code: Select all

./check_nrpe -H 10.11.96.194
Let's see which plugin works for you. Run the command below, and show the output:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 10.11.96.194
/usr/local/nagios/libexec/check_nrpe -H 10.11.96.194 -p 5666 -c CheckMem -a MaxWarn=80% MaxCrit=90% ShowAll type=physical

/usr/lib/nagios/plugins/check_nrpe -H 10.11.96.194
/usr/lib/nagios/plugins/check_nrpe -H 10.11.96.194 -p 5666 -c CheckMem -a MaxWarn=80% MaxCrit=90% ShowAll type=physical
Be sure to check out our Knowledgebase for helpful articles and solutions!
raydx
Posts: 34
Joined: Thu Jun 28, 2018 3:51 pm

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

Post by raydx »

Thank you for your assistance (and patience).

administrator@SVNagios02:/usr/local/nagios/libexec$ ./check_nrpe -H 10.11.96.194
I (0.5.2.35 2018-01-28) seem to be doing fine...
administrator@SVNagios02:/usr/local/nagios/libexec$ ./check_nrpe -H 10.11.96.194 -p 5666 -c CheckMem -a MaxWarn=80% MaxCrit=90% ShowAll type=physical
OK: physical: Total: 7.99GB - Used: 1.037GB (12%) - Free: 6.953GB (87%)|'physical'=1.0372GB;6.39235;7.19139;0;7.99044 'physical %'=13%;80;90;0;100
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

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

Post by lmiltchev »

The check_nrpe in libexec directory seems to be working fine, so let's try again the check that was failing:

Code: Select all

cd /usr/local/nagios/libexec
./check_nrpe -H 10.11.96.194 -c check_eventlog -a "filter=provider = 'SLMD UV Monitor Loader' and id = 0 and message like 'Config socket blocked' OR message like 'Inconsistent state'"
Do you have a section in the nsclient.ini file, named [/settings/eventlog]? Can you show us what are the directives that are defined under this section? If the check above fails, please post the nsclient.log from the Windows server.
Be sure to check out our Knowledgebase for helpful articles and solutions!
raydx
Posts: 34
Joined: Thu Jun 28, 2018 3:51 pm

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

Post by raydx »

nsclient.log
(11.42 KiB) Downloaded 257 times
Running the check that failed:
administrator@SVNagios02:/usr/local/nagios/libexec$ ./check_nrpe -H 10.11.96.194 -c check_eventlog -a "filter=provider = 'SLMD UV onitor Loader' and id =0 and message like 'Config socket blocked' OR message like 'Inconsistent state'"
CHECK_NRPE STATE CRITICAL: Socket timeout after 10 seconds.

nsclient.ini has the following sections:
; NRPE server settings
[/settings/NRPE/server]
allow arguments = true
allow nasty characters = true
insecure = true
verify mode = none

; NRPE modules
[/modules]
NRPEServer = enabled
CheckExternalScripts = enabled
CheckHelpers = enabled
CheckNSCP = enabled
CheckEventLog = enabled
CheckDisk = enabled
CheckSystem = enabled

The nsclient.ini is identical to the one on the server where this check does function without issue.

nsclient.log is attached. Thanks.
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 »

To be sure, edit the nsclient.ini file and verify that the following options for the eventlog check are in the file and setup like the following.

Code: Select all

[/settings/eventlog]
; 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

; 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

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

; SYNTAX - Set this to use a specific syntax string for all commands (that don't specify one).
syntax = UNKNOWN
Save and restart NSClient++

Another thing, the default timeout of the plugin is fairly short and if it takes some time to run the check, it could fail with the same message.

In the check_nrpe command, add a -t 59 to the command to increase it to 59 seconds.

Code: Select all

./check_nrpe -H 10.11.96.194 -c check_eventlog -t 59 -a "filter=provider = 'SLMD UV onitor Loader' and id =0 and message like 'Config socket blocked' OR message like 'Inconsistent state'"
Be sure to check out our Knowledgebase for helpful articles and solutions!
raydx
Posts: 34
Joined: Thu Jun 28, 2018 3:51 pm

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

Post by raydx »

Ran the ./check_nrpe with -t 59 and returned:
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).

In running with the up-date nsclient.ini file:
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).

The server where this check is functional, its nsclient.ini file does not have the options for the eventlog check and setup.
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 »

Can you post the full nsclient.ini file here so we can view in in case there is another configuration setting that is causing the check to fail?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked