NSClient++ Help (#1) - Unable to execute LUA script via NRPE (#578) - Message List
Hi!
I've written a command as a LUA function and I'm trying to query it from remote Nagios box via NRPE, but any attempt failed so far.
Just to check if the problem is anyhow bound to my function, I've made the same tests with standard lua_debug function, ending up wit
The function is available in /test mode:
[...] l NSClient++.cpp(438) Enter command to inject or exit to terminate... lua_debug a1 a2 d NSClient++.cpp(1073) Injecting: lua_debug: a1, a2 d NSClient++.cpp(1109) Injected Result: OK 'hello' d NSClient++.cpp(1110) Injected Performance Result: OK:hello
But if I try to call it from Nagios box I get:
$ ./check_nrpe -H 10.0.0.81 -p 5666 -c lua_debug -a a1 a2 UNKNOWN: No handler for that command $
Other NRPE checks work as expected. 10.0.0.81 is the right IP address.
There's something I'm overlooking? Any clues? Thank you.
-
Message #1759
I'm sorry for bad formatting. The test output is:
[...] l NSClient++.cpp(438) Enter command to inject or exit to terminate... lua_debug a1 a2 d NSClient++.cpp(1073) Injecting: lua_debug: a1, a2 d NSClient++.cpp(1109) Injected Result: OK 'hello' d NSClient++.cpp(1110) Injected Performance Result: '' OK:hello
While the remote check via NRPE is:
$ ./check_nrpe -H 10.0.0.81 -p 5666 -c lua_debug -a a1 a2 UNKNOWN: No handler for that command $
thank you
tx005/14/10 11:12:56 (3 years ago)-
Message #1760
Could you check the log from when you run from check_nrpe?
A good idea is to "stop" the service and use "NSClient++ /test" when you run from check_nrpe as that will give you any errors and such.
Michael Medin
mickem05/14/10 12:55:09 (3 years ago)-
Message #1761
I have stopped NSClient++ as a service and started it on the terminal with /test option. Now it's answering to lua_debug command as expected:
$ ./check_nrpe -H 10.0.0.81 -p 5666 -c lua_debug hello $
and the log reports:
2010-05-14 14:19:07: debug:NSClient++.cpp:1073: Injecting: lua_debug: ciao, mondo 2010-05-14 14:19:07: debug:NSClient++.cpp:1109: Injected Result: OK 'hello'
The NSC.ini contains:
[modules] FileLogger.dll CheckSystem.dll CheckDisk.dll NRPEListener.dll CheckEventLog.dll LUAScript.dll NSCAAgent.dll [Settings] password=************ allowed_hosts= use_file=1 [log] debug=1 file=NSC.log date_mask=%Y-%m-%d %H:%M:%S [Check System] CPUBufferSize=10m CheckResolution=10 [NRPE] port=5666 command_timeout=60 allow_arguments=1 allow_nasty_meta_chars=1 use_ssl=1 allowed_hosts=10.9.2.23/32, 92.42.97.4/32 [LUA Scripts] scripts\test.lua
tx005/14/10 14:24:18 (3 years ago)-
Message #1762
But it still does not work when you run as a service? (should not make difference really)
mickem05/14/10 15:45:28 (3 years ago)-
Message #1763
Exactly, as you can see here:
# ./check_nrpe -H 10.0.0.81 -p 5666 -c CheckDriveSize -a ShowAll MinWarnFree=1 MinCritFree=1 Drive=c: OK: c:: 52G|'c:'=55884980224B;320070287359;320070287359; # ./check_nrpe -H 10.0.0.81 -p 5666 -c lua_debug -a a1 a2 UNKNOWN: No handler for that command #
If restarted from the command line with /test, everything works as expected:
# ./check_nrpe -H 10.0.0.81 -p 5666 -c CheckDriveSize -a ShowAll MinWarnFree=1 MinCritFree=1 Drive=c: OK: c:: 52G|'c:'=55885119488B;320070287359;320070287359; # ./check_nrpe -H 10.0.0.81 -p 5666 -c lua_debug -a a1 a2 hello #
Just stopped the service from windows services panel and started it from the command line.
I'm using NSClient++ Version: 0.3.7.493 2009-10-12, Plattform: w32
tx005/14/10 16:19:01 (3 years ago)
-
-
-
-








