check_NRPE gave "Received 0 bytes from daemon"

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
caterpillartce
Posts: 117
Joined: Mon Jul 11, 2016 11:22 am

check_NRPE gave "Received 0 bytes from daemon"

Post by caterpillartce »

Hello,

I am trying to use check_NRPE to monitor physical memory usage on a windows server. This might be the first time check_nrpe is used. Is there anything I need to do to "enable" it as when I "Run the Check Command" when defining the service in CCM, it gives an error "Received 0 bytes from daemon". The nsclient log file has

"2017-07-21 11:57:50: error:c:\source\nscp\include\socket/connection.hpp:243: Failed to establish secure connection: unknown protocol: 252"

This is in NSCLIENT.INI:

[/settings/NRPE/server]

; Undocumented key
ssl options = no-sslv2,no-sslv3

; Undocumented key
; verify mode = peer-cert

; Undocumented key
insecure = true

Thanks!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_NRPE gave "Received 0 bytes from daemon"

Post by ssax »

Please attach your entire nsclient.ini so that we can review it, here is generally what needs to be set:

Code: Select all

[/modules]
; NRPEServer - A server that listens for incoming NRPE connection and processes incoming requests.
NRPEServer = 1


; TODO
[/settings/NRPE/server]

; ALLOW INSECURE CHIPHERS and ENCRYPTION - Only enable this if you are using legacy check_nrpe client.
insecure = 1

; COMMAND ALLOW NASTY META CHARS - This option determines whether or not the we will allow clients to specify nasty (as in |`&><'"\[]{}) characters in arguments.
allow nasty characters = 1

; EXTENDED RESPONSE - Send more then 1 return packet to allow response to go beyond payload size (requires modified client if legacy is true this defaults to false).
extended response = 0

; PORT NUMBER - Port to use for NRPE.
port = 5666

; COMMAND ARGUMENT PROCESSING - This option determines whether or not the we will allow clients to specify arguments to commands that are executed.
allow arguments = 1

; ENABLE SSL ENCRYPTION - This option controls if SSL should be enabled.
use ssl = 1
Also, what version of NSClient++ are you using? You can find it listed next to the name in the add/remove programs or programs and features section of the control panel.


Thank you
caterpillartce
Posts: 117
Joined: Mon Jul 11, 2016 11:22 am

Re: check_NRPE gave "Received 0 bytes from daemon"

Post by caterpillartce »

hi, I added port and allow argument based on above. Restarted NSClient service. But it did not help. I will PM you our nsclient.ini. Its version is 0.4.4.19.

Thanks
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: check_NRPE gave "Received 0 bytes from daemon"

Post by tacolover101 »

i feel like these contradict each other -

Code: Select all

; Undocumented key
ssl options = no-sslv2,no-sslv3

; Undocumented key
; verify mode = peer-cert

; Undocumented key
insecure = true
try commenting out ssl options if you're fine with insecure mode.

also post your nsclient.log as if it's SSL related, this will usually have more information.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_NRPE gave "Received 0 bytes from daemon"

Post by lmiltchev »

Are you calling an external script via check_nrpe?

In the majority of the cases, you would also need to set the following:

Code: Select all

CheckExternalScripts = 1
in the [/modules] section, and:

Code: Select all

allow nasty characters = 1
allow arguments = 1
in [/settings/external scripts] section.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_NRPE gave "Received 0 bytes from daemon"

Post by ssax »

Please post the entire check command you are running from the XI server, you can get it from the Run Check Command button when editing the service.

Thank you
caterpillartce
Posts: 117
Joined: Mon Jul 11, 2016 11:22 am

Re: check_NRPE gave "Received 0 bytes from daemon"

Post by caterpillartce »

I did all the above, but it is still failing with the same error. Attached please find the nsclient.ini and log file. I removed the allowed hosts for security in the ini file. The error about check_time in the log seems to have been there for ever and not related to check_NRPE.

Thanks!
You do not have the required permissions to view the files attached to this post.
caterpillartce
Posts: 117
Joined: Mon Jul 11, 2016 11:22 am

Re: check_NRPE gave "Received 0 bytes from daemon"

Post by caterpillartce »

And this is the check command: (I just wanted to monitor physical memory usage)

$USER1$/check_nrpe -H $HOSTADDRESS$ -n -c CheckMem -a type=physical MaxWarn=$ARG1$ MaxCrit=$ARG2$ ShowAll=long
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_NRPE gave "Received 0 bytes from daemon"

Post by lmiltchev »

Can you post the entire nsclient.ini file? You can redact it / remove sensitive info.

Run the following commands from the Nagios XI server and show the output:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <client ip>
/usr/local/nagios/libexec/check_nrpe -H <client ip> -c alias_mem
/usr/local/nagios/libexec/check_nrpe -H <client ip> -c CheckMem -a type=physical MaxWarn=$ARG1$ MaxCrit=$ARG2$ ShowAll=long
Be sure to check out our Knowledgebase for helpful articles and solutions!
caterpillartce
Posts: 117
Joined: Mon Jul 11, 2016 11:22 am

Re: check_NRPE gave "Received 0 bytes from daemon"

Post by caterpillartce »

The attached nsclient.ini is the entire file. The only thing I removed was the IP addresses of the allowed hosts.
I ran the commands on the Linux Nagios server and they all seemed to have worked fine. Attached is the screenshot.
Thanks!
You do not have the required permissions to view the files attached to this post.
Locked