NSClient++ ...can't get it to run external scripts

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
lyle
Posts: 158
Joined: Sun Nov 21, 2010 3:05 am

NSClient++ ...can't get it to run external scripts

Post by lyle »

I"m sorry to ask an NSClient++ question here, but I seem to be locked out of the NSClient++ forum, and resetting my password there isn't working. Maybe someone here has advice until I can post in the proper forum.

I can't get an external script to run from NSClient++. The host is a Windows 2008 box with NSClient++ 0.3.8.76

In the NSC.ini file, I've left it pretty much stock. But in the NRPE section, I've un-commented "check_es_ok=scripts\check_ok.bat" which points to the distributed check_ok.bat

From the Nagios server, calling an internal command:

Code: Select all

check_nrpe -H <our host> -c CheckCPU -a warn=80 crit=90 time=4s
runs fine

But this

Code: Select all

check_nrpe -H <our host> -c check_es_ok
returns "UNKNOWN: No handler for that command"

I turned on debugging in NSC.ini, but the debug log file just shows "Injecting: check_es_ok:" and then "No handler for command: 'check_es_ok'"

I've tried using check_es_ok="c:\Program Files\NSClient++\scripts\check_ok.bat" (the full directory spec) in NSC.ini, but that doesn't work.
I've tried enabling "script_dir=scripts", with and without the full directory spec, then using "-c check_ok" and "-c check_ok.bat" in the check_nrpe call, but none of that works. Of course, I'm restarting the service after every config change.

Any thoughts are appreciated. Thanks....Lyle
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: NSClient++ ...can't get it to run external scripts

Post by mguthrie »

This is something we probably need to document on our end, because we've had this question come up before, but I don't know if we've ever actually set it up ourselves. Here's what exists for NSClient's documentation on it.
http://www.nsclient.org/nscp/wiki/CheckExternalScripts

And here's an example from exchange:
http://exchange.nagios.org/directory/Pl ... le/details
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NSClient++ ...can't get it to run external scripts

Post by lmiltchev »

lyle,

You have un-commented "check_es_ok=scripts\check_ok.bat" in the NSC.ini file but did you un-comment the "CheckExternalScripts.dll" line in the [modules] section?
If you forgot to do so, you can try un-commenting it, then restart the nsclient++ service and give your command a try one more time.

Let us know if this helped.
Be sure to check out our Knowledgebase for helpful articles and solutions!
lyle
Posts: 158
Joined: Sun Nov 21, 2010 3:05 am

Re: NSClient++ ...can't get it to run external scripts

Post by lyle »

Of course! Un-comment "CheckExternalScripts.dll" What a dummy... ;-)

Thanks....Lyle
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NSClient++ ...can't get it to run external scripts

Post by lmiltchev »

I'm glad I could help!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked