Page 1 of 2

NRPE Test

Posted: Thu Apr 11, 2013 9:05 am
by Pilly170
I'm just playing around with NRPE, I downloaded a powershell script to check for windows updates

http://exchange.nagios.org/directory/Pl ... ll/details

Then followed this document
http://library.nagios.com/library/produ ... -nagios-xi

except that I didn't have in the nsclient.ini there wasn't a [/settings/external scripts/scripts] section. So I usedthe nsclient-full.ini

All was going ok, I could run the script locally on the windows powershell command line

but when I tried to run the script from nagios cli I got "No handler for command: check_updates"

I looked in the NRPE document
http://library.nagios.com/library/produ ... -solutions
XIV. UNKNOWN: No handler for that command
This is usually caused by a missing or incorrectly spelled handler (external alias) in the remote host's nsclient.ini/nsc.ini. Check the
spelling of the check_nrpe command for the service check in XI (the name of the command after the ā€œ-cā€). It should match the spelling
of the external alias in the nsclient config. For example:
[External Alias]
alias_cpu=checkCPU warn=80 crit=90 time=5m time=1m time=30s
...[truncated]...
In the example above, the bolded
The above isnt mentioned in the windows document.

Any ideas where I have gone wrong?

Re: NRPE Test

Posted: Thu Apr 11, 2013 9:32 am
by slansing
What version of NSClient++ are you using? The document was based on version 0.3.9 as it is the most easy to use. Take a look at this document as well for an explanation of the handler error:

http://assets.nagios.com/downloads/nagi ... utions.pdf

Once we know the NSClient++ version we can better assist.

Re: NRPE Test

Posted: Thu Apr 11, 2013 9:44 am
by Pilly170
Yep, thats the document I quoted from.

Client was downloaded from http://nsclient.org/nscp/downloads
NSCP-0.4.1.90-x64.msi

Re: NRPE Test

Posted: Thu Apr 11, 2013 10:00 am
by slansing
Okay, many things change with NSClient from release to release so we try to keep everything as consistent as possible with documentation on our side, thus the 0.3.9 suggestion. However, if you would like to use 0.4.x that is totally fine, can you send us your NSC/nsclient/nsclient-full.ini file, obfuscating any IP's/passwords you may have in there, just want to see how you have it defined.

Re: NRPE Test

Posted: Thu Apr 11, 2013 10:10 am
by Pilly170

Re: NRPE Test

Posted: Thu Apr 11, 2013 12:51 pm
by lmiltchev
Change this line:

Code: Select all

CheckExternalScripts = 0
to this:

Code: Select all

CheckExternalScripts = 1
Restart the NSClient++ service and try your check again. Let us know if this helped.

Re: NRPE Test

Posted: Fri Apr 12, 2013 7:38 am
by Pilly170
Changed this line in the nsclient-full.ini
; Check External Scripts - A simple wrapper to run external scripts and batch files.
CheckExternalScripts = 1
as this was already present in the nsclient.ini
; Undocumented key
CheckExternalScripts = 1
restarted the nsclient service
cd /usr/local/nagios/libexec
[root@nagios libexec]# ./check_nrpe -H "10.4.2.75" -t 120 -p 5666 -c check_updates
No handler for command: check_updates

Re: NRPE Test

Posted: Fri Apr 12, 2013 11:18 am
by abrist
Could you post you nsclient.ini in code wraps? (obfuscate password and any other sensitive bits)

Re: NRPE Test

Posted: Mon Apr 15, 2013 4:21 am
by Pilly170

Code: Select all

; Undocumented section
[/modules]

; Undocumented key
CheckDisk = 1

; Undocumented key
CheckEventLog = 1

; Undocumented key
CheckExternalScripts = 1

; Undocumented key
CheckHelpers = 1

; Undocumented key
CheckNSCP = 1

; Undocumented key
CheckSystem = 1

; Undocumented key
CheckWMI = 1

; Undocumented key
NRPEServer = 1

; Undocumented key
NSClientServer = 1


; Undocumented section
[/settings/default]

; Undocumented key
allowed hosts = myIP

; Undocumented key
password = mypassword

Re: NRPE Test

Posted: Mon Apr 15, 2013 10:16 am
by slansing
Is that all that is present in the nsclient.ini file? We will then go under the "assumption" that it's creator has changed everything over to use the nsclient-full.ini file...............

Can you post this one instead? I'm not sure why this was changed. You may have to downgrade to a lower version as there are bugs that have not been announced by the client's designer. That would also allow us to help you solve this much quicker, and easier.