Page 1 of 2
check_NRPE gave "Received 0 bytes from daemon"
Posted: Fri Jul 21, 2017 12:02 pm
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!
Re: check_NRPE gave "Received 0 bytes from daemon"
Posted: Fri Jul 21, 2017 1:34 pm
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
Re: check_NRPE gave "Received 0 bytes from daemon"
Posted: Fri Jul 21, 2017 4:01 pm
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
Re: check_NRPE gave "Received 0 bytes from daemon"
Posted: Sun Jul 23, 2017 10:59 pm
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.
Re: check_NRPE gave "Received 0 bytes from daemon"
Posted: Mon Jul 24, 2017 9:20 am
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:
in the [/modules] section, and:
Code: Select all
allow nasty characters = 1
allow arguments = 1
in [/settings/external scripts] section.
Re: check_NRPE gave "Received 0 bytes from daemon"
Posted: Mon Jul 24, 2017 9:33 am
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
Re: check_NRPE gave "Received 0 bytes from daemon"
Posted: Thu Jul 27, 2017 2:58 pm
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!
Re: check_NRPE gave "Received 0 bytes from daemon"
Posted: Thu Jul 27, 2017 2:59 pm
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
Re: check_NRPE gave "Received 0 bytes from daemon"
Posted: Thu Jul 27, 2017 3:52 pm
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
Re: check_NRPE gave "Received 0 bytes from daemon"
Posted: Fri Jul 28, 2017 9:07 am
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!