Page 3 of 4

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

Posted: Mon Nov 12, 2018 5:15 pm
by raydx
nsclient.ini
(2.08 KiB) Downloaded 496 times

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

Posted: Mon Nov 12, 2018 5:36 pm
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.

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

Posted: Mon Nov 12, 2018 6:14 pm
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.

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

Posted: Tue Nov 13, 2018 9:55 am
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.

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

Posted: Tue Nov 13, 2018 1:14 pm
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

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

Posted: Tue Nov 13, 2018 2:00 pm
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.

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

Posted: Tue Nov 13, 2018 2:28 pm
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.

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

Posted: Tue Nov 13, 2018 3:25 pm
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)

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

Posted: Tue Nov 13, 2018 6:04 pm
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.

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

Posted: Wed Nov 14, 2018 3:05 pm
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.