Page 1 of 1

How do I get check_nrpe to work without -n option?

Posted: Wed Feb 22, 2017 4:38 am
by nelsonw
Hi,

I am very interested in purchasing NagiosXI, but cannot get check_nrpe to work. Please can you help.


I cannot pass the -n option when setting up the check_nrpe service within NagiosXI. The command it provides me in NagiosXI GUI is

"$USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$"

However, when passing -n option as $ARG2, I get a "FAILED" return code, even though my command defined in $ARG1 is set up to success.
If I run check_nrpe from the command line and put the -n option between the -t and -c arguments, I get the correct results

Please advise either
a) How I can pass the -n option between the -t and -c options from within NagiosXI GUI

or

b) Avoid the need for running check_nrpe with the -n option. Currently, if I exclude -n, check_nrpe returns
CHECK_NRPE: Socket timeout after 30 seconds.

My configuration settings in nsclient.ini are

; TODO
[/settings/NRPE/server]

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

; Undocumented key
verify mode = peer-cert

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

; 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 = 1

; ENABLE SSL ENCRYPTION - This option controls if SSL should be enabled.
use ssl = false

; COMMAND ARGUMENT PROCESSING - This option determines whether or not the we will allow clients to specify arguments to

commands that are executed.
allow arguments = true

; 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 = true

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

; TODO
[/modules]

Re: How do I get check_nrpe to work without -n option?

Posted: Wed Feb 22, 2017 4:08 pm
by mcapra
nelsonw wrote: a) How I can pass the -n option between the -t and -c options from within NagiosXI GUI
You could alter the check_nrpe command definition itself in the Core Config Manager:
2017_02_22_14_58_02_CCM_Nagios_XI.png
Or instead you could try the check_nrpe_no_ssl command.
nelsonw wrote: b) Avoid the need for running check_nrpe with the -n option. Currently, if I exclude -n, check_nrpe returns
CHECK_NRPE: Socket timeout after 30 seconds.
Try changing the following directive in your NSClient++ configuration under [/settings/NRPE/server] to true:

Code: Select all

use ssl = true
Then restarting the NSClient++ service (nscp).

Re: How do I get check_nrpe to work without -n option?

Posted: Wed Feb 22, 2017 4:45 pm
by nelsonw
Thanks. Please let me know where I can find check_nrpe_no_ssl. I cannot see it in the list of commands in NagiosXI or when searching plugins on Nagios Exchange

Re: How do I get check_nrpe to work without -n option?

Posted: Wed Feb 22, 2017 5:13 pm
by mcapra
Whoops, that's a custom command. It's just using a wrapper script to call check_nrpe with -n anyway. You could copy the check_nrpe command, rename it check_nrpe_no_ssl, and add the -n argument to achieve the same effect.
2017_02_22_16_12_54_CCM_Nagios_XI.png
2017_02_22_16_13_09_CCM_Nagios_XI.png
2017_02_22_16_14_21_CCM_Nagios_XI.png

Re: How do I get check_nrpe to work without -n option?

Posted: Wed Mar 29, 2017 10:27 am
by nelsonw
Thanks, that worked

Re: How do I get check_nrpe to work without -n option?

Posted: Wed Mar 29, 2017 11:39 am
by cdienger
Glad to hear : ) Are we okay closing the thread or do you have any more questions related to this?