NRPE Test

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

NRPE Test

Post 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?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: NRPE Test

Post 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.
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Re: NRPE Test

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: NRPE Test

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NRPE Test

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Re: NRPE Test

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: NRPE Test

Post by abrist »

Could you post you nsclient.ini in code wraps? (obfuscate password and any other sensitive bits)
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Pilly170
Posts: 75
Joined: Thu Mar 28, 2013 6:03 am

Re: NRPE Test

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: NRPE Test

Post 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.
Locked