NSClient++ Help (#1) - Upgrade 0.3.x --> 0.4.x: No handler for command (#969) - Message List

Upgrade 0.3.x --> 0.4.x: No handler for command

Hi,

I've upgraded my NSClient++ 0.3.x to the latest 0.4.x and all my aliases stopped to work. In the log file I can see the following:

2012-05-10 14:19:12: l:..\..\..\trunk\service\NSClient++.cpp:385: NSClient++ 0,4,0,172 2012-05-08 w32 booting... 2012-05-10 14:20:14: e:..\..\..\trunk\service\NSClient++.cpp:943: No handler for command: checkversion avalible commands: commands {, checkwmi, checkwmivalue, nrpe_exec, nrpe_forward, nrpe_help, nrpe_query, nrpe_submit}, plugins {, 0, 2}

It looks like a lack of modules. But the files are in place and the configuration allows the modules to operate:

Old Config:

[modules]
NRPEListener.dll
NSClientListener.dll
CheckWMI.dll
FileLogger.dll
CheckSystem.dll
CheckDisk.dll
CheckEventLog.dll
CheckHelpers.dll
;# NSCLIENT++ MODULES
;# A list with DLLs to load at startup.
;  You will need to enable some of these for NSClient++ to work.
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
; *                                                               *
; * N O T I C E ! ! ! - Y O U   H A V E   T O   E D I T   T H I S *
; *                                                               *
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
;FileLogger.dll
;CheckSystem.dll
;CheckDisk.dll
;NSClientListener.dll
;NRPEListener.dll
;SysTray.dll
;CheckEventLog.dll
;CheckHelpers.dll
;CheckWMI.dll
;CheckNSCP.dll
;
; Script to check external scripts and/or internal aliases.
CheckExternalScripts.dll
;
; NSCA Agent if you enable this NSClient++ will talk to NSCA hosts repeatedly (so dont enable unless you want to use NSCA)
;NSCAAgent.dll
;
; LUA script module used to write your own "check deamon".
;LUAScript.dll
;
; RemoteConfiguration IS AN EXTREM EARLY IDEA SO DONT USE FOR PRODUCTION ENVIROMNEMTS!
;RemoteConfiguration.dll
; Check other hosts through NRPE extreme beta and probably a bit dangerous! :)
;NRPEClient.dll
; Extreamly early beta of a task-schedule checker
;CheckTaskSched.dll

New config:

; A list of modules.
[/modules]
; Undocumented key
CheckDisk = 0
; Undocumented key
CheckEventLog = 0
; Undocumented key
CheckExternalScripts = 0
; Undocumented key
CheckHelpers = 0
; Undocumented key
CheckNSCP = 0
; Undocumented key
CheckSystem = 0
; CheckWMI - CheckWMI can check various file and disk related things. The current version has commands to check Size of hard drives and directories.
CheckWMI = 1
; Undocumented key
FileLogger.dll =
; NRPE server - A simple server that listens for incoming NRPE connection and handles them. NRPE is preferred over NSClient as it is more flexible. You can of cource use both NSClient and NRPE.
NRPEServer = 1
; NSClient server - A simple server that listens for incoming NSClient (check_nt) connection and handles them. Although NRPE is the preferred method NSClient is fully supported and can be used for simplicity or for compatibility.
NSClientServer = 1

Before the upgrade everything worked just fine.

I tried to change zeroes into ones, but it didn't help.

  • Message #2586

    How does the alias definition look in the configuration?

    • Message #2593

      Aliases before upgrade:

      [External Alias]
      alias_disk_c = CheckDriveSize ShowAll=long MinWarn=6% MinCrit=3% CheckAll FilterType=FIXED Drive=c:
      alias_disk_e = CheckDriveSize ShowAll=long MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED Drive=e:
      alias_disk_f = CheckDriveSize ShowAll=long MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED Drive=f:
      alias_service_web = checkServiceState ShowAll W3SVC=started
      alias_mem_paged = checkMem MaxWarn=80% MaxCrit=90% ShowAll=long type=paged
      alias_CheckEventLog=CheckEventLog file=application file=system MaxWarn=1 MaxCrit=1 "filter=generated gt -1h AND severity NOT IN ('success', 'informational') " truncate=800 unique descriptions "syntax=%severity%: %source%: %id%: %message% (%count%)"
      alias_cpu=checkCPU warn=80 crit=90 time=5m time=1m time=30s
      alias_cpu_ex=checkCPU warn=$ARG1$ crit=$ARG2$ time=5m time=1m time=30s
      alias_mem=checkMem MaxWarn=80% MaxCrit=90% ShowAll=long type=physical type=virtual type=paged type=page
      alias_up=checkUpTime MinWarn=1d MinWarn=1h
      alias_disk=CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED
      alias_disk_loose=CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED ignore-unreadable
      alias_volumes=CheckDriveSize MinWarn=10% MinCrit=5% CheckAll=volumes FilterType=FIXED
      alias_volumes_loose=CheckDriveSize MinWarn=10% MinCrit=5% CheckAll=volumes FilterType=FIXED ignore-unreadable
      

      Aliases after upgrade:

      ; Undocumented section
      [/settings/external scripts/alias]
      ; Undocumented key
      alias_CheckEventLog = CheckEventLog file=application file=system MaxWarn=1 MaxCrit=1 "filter=generated gt -1h AND severity NOT IN ('success', 'informational') " truncate=800 unique descriptions "syntax=%severity%: %source%: %id%: %message% (%count%)"
      ; Undocumented key
      alias_cpu = checkCPU warn=80 crit=90 time=5m time=1m time=30s
      ; Undocumented key
      alias_cpu_ex = checkCPU warn=$ARG1$ crit=$ARG2$ time=5m time=1m time=30s
      ; Undocumented key
      alias_disk = CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED
      ; Undocumented key
      alias_disk_c = CheckDriveSize ShowAll=long MinWarn=6% MinCrit=3% CheckAll FilterType=FIXED Drive=c:
      ; Undocumented key
      alias_disk_e = CheckDriveSize ShowAll=long MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED Drive=e:
      ; Undocumented key
      alias_disk_f = CheckDriveSize ShowAll=long MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED Drive=f:
      ; Undocumented key
      alias_disk_loose = CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED ignore-unreadable
      ; Undocumented key
      alias_event_log = CheckEventLog file=application file=system MaxWarn=1 MaxCrit=1 "filter=generated gt -2d AND severity NOT IN ('success', 'informational') AND source != 'SideBySide'" truncate=800 unique descriptions "syntax=%severity%: %source%: %message% (%count%)"
      alias_mem_paged = checkMem MaxWarn=80% MaxCrit=90% ShowAll=long type=paged
      

      ...

      I didn't copied everything, just some examples.

      Now I can see in the log file:

      2012-05-14 10:27:46: e:..\..\..\..\trunk\include\nscapi\nscapi_core_wrapper.cpp:181: No handler for command 'alias_mem_paged'.
      2012-05-14 10:27:50: e:..\..\..\trunk\service\NSClient++.cpp:943: No handler for command: alias_cpu avalible commands: commands {, checkwmi, checkwmivalue}, plugins {, 0}
      2012-05-14 10:27:50: e:..\..\..\..\trunk\include\nscapi\nscapi_core_wrapper.cpp:181: No handler for command 'alias_cpu'.
      2012-05-14 10:27:54: e:..\..\..\trunk\service\NSClient++.cpp:943: No handler for command: alias_disk_f avalible commands: commands {, checkwmi, checkwmivalue}, plugins {, 0}
      

      I don't think it's an alias definition problem, at least because we can see in the log file that the application fails answering to 'checkversion' call.

      'Available commands' in the log file also look weird for me.

      • Message #2605

        Have you tried the nightly build 173?

        Which supposedly fixes an issue relating to having multiple sections for the same thing? If not please either email (michael<AT>medin<DOT>name) or past full config file.

        This looks good/works for me...

        nscp test
        ...
        commands
        l ce\simple_client.hpp:54   Commands:
        l ce\simple_client.hpp:57   | alias_checkeventlog: Alias for: alias_CheckEventLog
        l ce\simple_client.hpp:57   | alias_cpu: Alias for: alias_cpu
        l ce\simple_client.hpp:57   | alias_cpu_ex: Alias for: alias_cpu_ex
        l ce\simple_client.hpp:57   | alias_disk: Alias for: alias_disk
        l ce\simple_client.hpp:57   | alias_disk_c: Alias for: alias_disk_c
        l ce\simple_client.hpp:57   | alias_disk_e: Alias for: alias_disk_e
        l ce\simple_client.hpp:57   | alias_disk_f: Alias for: alias_disk_f
        l ce\simple_client.hpp:57   | alias_disk_loose: Alias for: alias_disk_loose
        l ce\simple_client.hpp:57   | alias_event_log: Alias for: alias_event_log
        l ce\simple_client.hpp:57   | alias_mem_paged: Alias for: alias_mem_paged
        l ce\simple_client.hpp:57   | checkcounter: Check a PDH counter.
        l ce\simple_client.hpp:57   | checkcpu: Check the CPU load of the computer.
        l ce\simple_client.hpp:57   | checkmem: Check free/used memory on the system.
        l ce\simple_client.hpp:57   | checkprocstate: Check the state of one or more of the processes running on the computer.
        l ce\simple_client.hpp:57   | checkservicestate: Check the state of one or more of the computer services.
        l ce\simple_client.hpp:57   | checksingleregentry: Check registry key
        l ce\simple_client.hpp:57   | checkuptime: Check the up-time of the computer.
        l ce\simple_client.hpp:57   | foo: Alias for: foo
        l ce\simple_client.hpp:57   | listcounterinstances: List all instances for a counter.
        alias_cpu
        d rvice\NSClient++.cpp:923  Injecting: alias_cpu...
        l kExternalScripts.cpp:229  Arguments: warn=80 crit=90 time=5m time=1m time=30s
        d rvice\NSClient++.cpp:923  Injecting: checkcpu...
        d rvice\NSClient++.cpp:947  Result checkcpu: OK
        d rvice\NSClient++.cpp:947  Result alias_cpu: OK
        l ce\simple_client.hpp:80   OK:OK CPU Load ok.
        l ce\simple_client.hpp:82    Performance data: '5m'=7%;80;90 '1m'=7%;80;90 '30s'=7%;80;90
        

        Michael Medin

        • Message #2612

          Have just tried with 0.4.0.174 and got the same error. I'm sending you the config files and the log file. Thank you!

          • Message #2619

            The problem is I think that during installation you did not select the externalscripts module (In the which modules to enable).

            Regardless the solution is to enable CheckExternalScript? like so:

            nscp settings --path /modules --key CheckExternalScripts --set 1
            

            Or simply edit the file manually...

            I shall investigate the upgrade procedure a bit which is flaky...

            Michael Medin

            • Message #2622

              During the installation, I don't remember any mention of CheckExternalScripts. I choose 'Custom', then select all files, then I can see the Choose Modules screen, where I can enable

              Common Check Modules; check_nt; NRPE; NSCA; WMI

              By default (or after parsing my old config) all modules are checked except NSCA. No other place to select CheckExternalScripts...

              Today I tried to install the latest nightly build (0.4.1) and it does not return the alias related errors. But still doesn't work. The log file looks like:

              2012-06-07 06:17:25: l:..\..\..\trunk\service\NSClient++.cpp:385: NSClient++ 0,4,1,1 2012-06-05 w32 booting...
              2012-06-07 06:17:59: e:D:\source\nscp\trunk\include\socket/connection.hpp:126: Failed to read data: End of file
              2012-06-07 06:18:59: e:D:\source\nscp\trunk\include\socket/connection.hpp:126: Failed to read data: End of file
              2012-06-07 06:18:59: e:D:\source\nscp\trunk\include\socket/connection.hpp:126: Failed to read data: End of file
              2012-06-07 06:18:59: e:D:\source\nscp\trunk\include\socket/connection.hpp:126: Failed to read data: End of file
              2012-06-07 06:19:02: e:D:\source\nscp\trunk\include\socket/connection.hpp:126: Failed to read data: End of file
              2012-06-07 06:19:21: e:D:\source\nscp\trunk\include\socket/connection.hpp:126: Failed to read data: End of file
              2012-06-07 06:19:25: e:D:\source\nscp\trunk\include\socket/connection.hpp:126: Failed to read data: End of file
              2012-06-07 06:19:33: e:D:\source\nscp\trunk\include\socket/connection.hpp:126: Failed to read data: End of file
              2012-06-07 06:19:37: e:D:\source\nscp\trunk\include\socket/connection.hpp:126: Failed to read data: End of file
              2012-06-07 06:19:49: e:D:\source\nscp\trunk\include\socket/connection.hpp:126: Failed to read data: End of file
              2012-06-07 06:19:59: e:D:\source\nscp\trunk\include\socket/connection.hpp:126: Failed to read data: End of file
              2012-06-07 06:20:08: e:D:\source\nscp\trunk\include\socket/connection.hpp:126: Failed to read data: End of file
              2012-06-07 06:20:29: e:D:\source\nscp\trunk\include\nrpe/server/protocol.hpp:90: Digester failed to parse chunk, giving up.
              2012-06-07 06:20:29: e:D:\source\nscp\trunk\include\nrpe/server/protocol.hpp:90: Digester failed to parse chunk, giving up.
              2012-06-07 06:20:32: e:D:\source\nscp\trunk\include\nrpe/server/protocol.hpp:90: Digester failed to parse chunk, giving up.
              2012-06-07 06:20:55: e:D:\source\nscp\trunk\include\nrpe/server/protocol.hpp:90: Digester failed to parse chunk, giving up.
              2012-06-07 06:21:07: e:D:\source\nscp\trunk\include\nrpe/server/protocol.hpp:90: Digester failed to parse chunk, giving up.
              2012-06-07 06:21:19: e:D:\source\nscp\trunk\include\nrpe/server/protocol.hpp:90: Digester failed to parse chunk, giving up.
              2012-06-07 06:21:29: e:D:\source\nscp\trunk\include\nrpe/server/protocol.hpp:90: Digester failed to parse chunk, giving up.
              
              • Message #2624

                As for the other issue, you are right it is part of common checks... So if you ticked that it should have worked... need to look into it...

                Michael Medin

              • Message #2623

                Whoooha... 0.4.1 is veeery unstable... don't install it unless you want to play around :)

                But seems I messed up the NRPE server then...

                Michael Medin

    • Message #2615

      Same problem here. Also sending configs.

Subscriptions