NSClient++ Help (#1) - NRPE Checks fail - UNKNOWN: No Handler when running as service [SOLVED] (#592) - Message List

NRPE Checks fail - UNKNOWN: No Handler when running as service [SOLVED]

Hi there,

I'm having trouble with executing NRPE checks with NSClient++.

root@NAGPROD03:/usr/local/nagios/libexec# ./check_nrpe -H MF06NODE01 -c check_oracleping
UNKNOWN: No handler for that command
root@NAGPROD03:/usr/local/nagios/libexec#

There's nothing in nsclient.log. When I run NSClient++ /test the checks work fine:

C:\Program Files\NagiosClient>net stop nsclientpp && "NSClient++.exe" /test
The NSClient++ (Win32) service is stopping.
The NSClient++ (Win32) service was stopped successfully.

Launching test mode - client mode

l \NSClient++.cpp(370) Attempting to start NSCLient++ - 0.3.5.2 2008-09-24
e \NSClient++.cpp(453) Exception raised: Could not load library: 126: The specif
ied module could not be found.
 in module: LUAScript.dll
d \NSClient++.cpp(773) Loading plugin: CheckDisk...
d \NSClient++.cpp(773) Loading plugin: Event log Checker....
d \NSClient++.cpp(773) Loading plugin: Check External Scripts...
d \NSClient++.cpp(773) Loading plugin: Helper function...
d \NSClient++.cpp(773) Loading plugin: CheckSystem...
d \NSClient++.cpp(773) Loading plugin: File logger...
d \PDHCollector.cpp(66) Autodetected w2k or later, using w2k PDH counters.
d \PDHCollector.cpp(103) Using index to retrive counternames
l \FileLogger.cpp(93) Log path is: C:\Program Files\NagiosClient\\nsclient.log
d \NSClient++.cpp(773) Loading plugin: NRPE client...
d \NRPEClient.cpp(49) humm...
d \NRPEClient.cpp(51) check_other
d \NRPEClient.cpp(79) Added NRPE Client: check_other = host: 192.168.0.1, port:
5666, timeout: 10, ssl: 1, buffer_length: 1024
d \NSClient++.cpp(773) Loading plugin: NRPE server...
d \PDHCollector.cpp(123) Found countername: CPU:    \Processor(_total)\% Process
or Time
d \PDHCollector.cpp(124) Found countername: UPTIME: \System\System Up Time
d \PDHCollector.cpp(125) Found countername: MCL:    \Memory\Commit Limit
d \PDHCollector.cpp(126) Found countername: MCB:    \Memory\Committed Bytes
d \NSClient++.cpp(773) Loading plugin: NSCAAgent...
d \Socket.h(637) Bound to: 0.0.0.0:5666
d \NSCAThread.cpp(46) Autodetected hostname: MF06NODE01
d \NSClient++.cpp(773) Loading plugin: NSClient server...
d \NSClient++.cpp(773) Loading plugin: SystemTray...
d \Socket.h(637) Bound to: 0.0.0.0:12489
d \NSCAThread.cpp(115) Drifting: 0
e \SysTray.cpp(51) SysTray is not installed (or it cannot interact with the desk
top) SysTray won't be loaded. Run NSClient++ SysTray install to change this.
l \NSClient++.cpp(476) NSCLient++ - 0.3.5.2 2008-09-24 Started!
l \NSClient++.cpp(278) Using settings from: INI-file
l \NSClient++.cpp(279) Enter command to inject or exit to terminate...
d \NSClientListener.cpp(146) Data: myh4th4sthr33c0rn3rs&1
d \NSClientListener.cpp(171) Data:
d \NSClient++.cpp(910) Injecting: check_oracleping:
d \NSClient++.cpp(946) Injected Result: CRITICAL '"CRIT $ARG1$ - TNS-03505: Fail
ed to resolve name"'
d \NSClient++.cpp(947) Injected Performance Result: ''
d \NSClient++.cpp(910) Injecting: check_oracleping: INTPRD
d \NSClient++.cpp(946) Injected Result: OK '"OK INTPRD - OK (470 msec)"'
d \NSClient++.cpp(947) Injected Performance Result: ''
root@NAGPROD03:/usr/local/nagios/libexec# ./check_nrpe -H MF06NODE01 -c check_oracleping
"CRIT $ARG1$ - TNS-03505: Failed to resolve name"
root@NAGPROD03:/usr/local/nagios/libexec# ./check_nrpe -H MF06NODE01 -c check_oracleping -a INTPRD
"OK INTPRD - OK (470 msec)"
root@NAGPROD03:/usr/local/nagios/libexec#

When running as a service NRPE still responds, but none of the other checks (like check_es_ok) work.

root@NAGPROD03:/usr/local/nagios/libexec# ./check_nrpe -H MF06NODE01
I (0.3.8.69 2010-05-19) seem to be doing fine...

Has anyone else seen this? Have tried upgrading NSClient++ to latest stable, and confirmed service is running as local system.

Many thanks Gareth

  • Message #1805

    Sorry the formatting is kind of ugly, it looks nicer here:

    http://pastebin.com/Ryae5DMV

    Any help wuold be greatly appreciated.

    Cheers Gareth

  • Message #1807

    Uhmm...

    Why would there be a "check_oracleping" command?

    Michael Medin

    • Message #1809

      Hi Michael,

      Oops sorry for not making that clear in the previous post. I have configured a custom NRPE check below:

      [modules]
      FileLogger.dll
      CheckSystem.dll
      CheckDisk.dll
      NSClientListener.dll
      NRPEListener.dll
      SysTray.dll
      CheckEventLog.dll
      CheckHelpers.dll

      [NRPE]
      port=5666
      allow_arguments=1
      allowed_hosts=10.10.12.97

      [NRPE Handlers]
      check_oracleping=scripts\oracleping.bat $ARG1$
      nrpe_ok=scripts\ok.bat

      But get the error above. It works when running nsclient++ /test

      Also nrpe_ok gives the same thing? I've probably stuffed something up somewhere :/

      Thanks for your help Gareth

      • Message #1810

        Humm, ok...

        Looks like some configuration miss match.,

        Are you maybe running two instances?

        nsclient++ /svc will give you the path of the service check that it is the correct one you use.

        Also enable (debug) logging so you can see if there is anything wrong when you run it as a service.

        Michael Medin

        • Message #1842

          I wanted to chime in as I have been having a similar problem.

          My goal is to execute scripts on a Windows computer using the check_nrpe command.

          [root]# /usr/local/nagios/libexec/check_nrpe -H 10.14.6.4

          I (0.3.8.76 2010-05-27) seem to be doing fine...

          [root]# /usr/local/nagios/libexec/check_nrpe -H 10.14.6.4 -c check_es_ok

          UNKNOWN: No handler for that command

          I can communicate with the Daemon, which means it isn't a connection issue. Any attempt to run any check command through the command line on my remote server gives the same UNKNOWN: No handler for that command.

          Here is the relevant (to my knowledge) part of NSC.ini:

          [modules]

          NRPEListener.dll

          NSClientListener.dll

          FileLogger.dll

          CheckSystem.dll

          CheckDisk.dll

          CheckEventLog.dll

          CheckHelpers.dll

          script_dir="C:\Program Files\NSClient++\scripts\"

          [Script Wrappings]

          vbs=cscript.exe T:30 NoLogo scripts\lib\wrapper.vbs %SCRIPT% %ARGS%

          ps1=cmd /c echo scripts\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command -

          bat=scripts\%SCRIPT% %ARGS%

          [External Scripts]

          check_es_long=scripts\long.bat

          check_es_ok=scripts\ok.bat

          check_es_nok=scripts\nok.bat

          check_vbs_sample=cscript.exe T:30 NoLogo scripts\check_vb.vbs

          check_powershell_warn=cmd /c echo scripts\powershell.ps1 | powershell.exe -command -

          [External Alias]

          . . .

          check_ok=CheckOK Everything is fine!

          [NRPE Client Handlers]

          check_other=-H 192.168.0.1 -p 5666 -c remote_command -a arguments

          Do I need to add something to the NRPE Client Handlers section?

          Here are the entries from Nagios:

          # 'check_nt' command definition

          define command{

          command_name check_nt

          command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -s

          nagiosadmin -v $ARG1$ $ARG2$

          }

          # 'check_nrpe' command definition

          define command{

          command_name check_nrpe

          command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$

          }

          define service{

          use generic-service

          host_name PC4

          service_description Test

          check_command check_nrpe! -c check_es_ok

          }

          define service{

          use generic-service

          host_name PC4

          service_description Test2

          check_command check_nrpe!-c ok.bat

          }

          Sorry for the lengthy post. What could be causing this?

          • Message #1844

            Sorry for pseudo-spamming your board, I figured out why my set-up wasn't working: I had specified the external script directory under [External Scripts] but NOT under [NRPE].

            Once I added the external scripts directory under the [NRPE] tag my scripts were properly executed by the check_nrpe command.

            Hopefully others can learn from my mistake.

            • Message #1845

              humm...

              [External Script]
              ;# SCRIPT DIRECTORY
              ;  All files in this directory will become check commands.
              ;  *WARNING* This is undoubtedly dangerous so use with care!
              ;script_dir=c:\my\script\dir
              

              That should work (if it does not it is a bug). But it should not be under [External Scripts].

              NRPE has the same functions as the CheckExternalScripts module but it is "deprecated".

              Michael Medin

Subscriptions