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 »

nsclient.ini
(2.08 KiB) Downloaded 377 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 »

There were some duplication and some options in the wrong section of the ini file so I updated it and added it to the post.
Make a backup of your copy and replace it with the attached copy.
Restart the NSClient++ service and see if it works.
Attachments
nsclient.ini
(1.98 KiB) Downloaded 412 times
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'm getting the same result.

On the server where the check is functional, I used the nclient.ini file that you provided and the check still functions
as expected.
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 »

Are you still receiving this error in the nsclient.log file?
connection.hpp:139: Socket was unexpectedly closed trying to send data (possibly check your timeout settings)
Then try this, under this section

Code: Select all

[settings/NPRE/server]
add this

Code: Select all

timeout = 60
Also in this section

Code: Select all

[/settings/default]
Change this from

Code: Select all

timeout = 30
to

Code: Select all

timeout = 60
Save the setting and restart NSClient++ and see if it works and if the errors are gone from the nsclient.log file.
If it still fails, I suggest removing the Nsclient++ agent from the server and deleting the folder that is was installed in.
Install the latest stable 0.4.4.xx version and see if that works.
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 edited my nsclient.ini file per your requests - same result. Same result when timeout increased to 90.

Uninstalled and re-installed:
Socket was unexpectedly closed trying to send data (possibly check your timeout settings) in nsclientlog
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected) displayed on Nagios client for status information

Up-dated nsclient.ini to include timeouts:
Socket was unexpectedly closed trying to send data (possibly check your timeout settings) in nsclientlog
(Service check timed out after 60.01 seconds) displayed on Nagios Client for status information
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 »

Check the nsclient.log file for any errors and you should check the Windows Eventlogs for any errors as well.

The NSClient++ agent runs as a System login account and maybe it does not have permissions to run the check.

You can test the command on the Windows server using nscp in a command prompt.

Login to the Windows server as an administrator and go to the following folder

Code: Select all

C:\Program Files\NSClient++
Run this to go in to testing mode.

Code: Select all

nscp test
Then, run your command in the test windows and hopefully is will output some sort of error that could help you troubleshoot the Windows server and NSClient++

Code: Select all

check_eventlog "filter=provider = 'SLMD UV Monitor Loader' and id = 0 and message like 'Config socket blocked' OR message like 'Inconsistent state'"
https://docs.nsclient.org/howto/checks/
If you cannot get it to work, you can look in the NSClient++ forums for any help and post there as well.
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 and the Nagios team for your assistance.

I ran nscp and check_eventlog "filter=provider = 'SLMD UV Monitor Loader' and id = 0 and message like 'Config socket blocked' OR message like 'Inconsistent state'":
L cli OK: OK: No entries found
L cli Performance data: 'problem_count'=0;0;0

This is the correct information.
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 rece

Post by scottwilkerson »

You have stated that you are running this query fine on another server, (via PM) are the nsclient.ini files the same on both?

Are they both running the same version of NSClient++?

Can you run any commands successfully on this server (could be firewall check port 5666 and 12489 are open)
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
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.ini is identical on both servers.

Both servers have the same version of NSClient++.

Both servers have identical Inbound Rule for NSClient++ Monitoring Agent.

Ports 5666 and 12489 are open.
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 »

When you ran the check_eventlog command on the Windows server in the nscp test window, how long did it take to run?

Add this to the bottom of the nsclient.ini file to enable debugging to the nsclient.log file

Code: Select all

[/settings/log]

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

; FILENAME - The file to write log data to. Set this to none to disable log to file.
file name = nsclient.log

; 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


[/settings/log/file]

; MAXIMUM FILE SIZE - When file size reaches this it will be truncated to 50% if set to 0 (default) truncation will be disabled
max size = 2048000
Restart the NSClient++ agent.

Run the check again from the Nagios server and get the nsclient.log file from the Windows Host and post it here.

Thanks.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked