NSClient++ Help (#1) - Has listCounterInstances syntax changed in version 4. (#1024) - Message List

Has listCounterInstances syntax changed in version 4.

Quick question has the command listCounterInstances changed in version 4.

I cannot seem to get the listCounterInstances command to work in version 4 for any peformance counter. The command works perfectly in version 3.

for example

check_nrpe -n -t 60 -H myhost -c listCounterInstances -a "Network Interface" returns "Broadcom BCM5709C NetXtreme? II GigE [NDIS VBD Client] _36"

but in version I (0,4,0,172 2012-05-08) I get the following error

ERROR: Failed to enumerate counter instances: RESOLVER: EnumObjectInstances?: Could not find index: Network Interface : -1073738824: The specified object was not found on the computer.

I know the counter is available though. If I run "nscp client --module CheckSystem --exec listpdh"

I can clearly find the counter "\Network Interface". Any help would be appreciated.

Here is my nsclient.ini

[/settings/default]
cache allowed hosts=1
allowed hosts=nagios_host
use ssl=0
timeout=300
[/modules]
CheckDisk = 1
CheckEventLog = 0
CheckExternalScripts = 1
CheckHelpers = 1
CheckSystem = 1
CheckWMI = 1
NRPEServer = 1
CauseCrashes = 1
[/settings/log]
file name = nsclient.log
level=trace
[/settings/log/file]
max size = 2048000
[/settings/NRPE/server]
port=5666
timeout=300
allow arguments=1
allow nasty characters=1
performance data=1
[/settings/external scripts]
timeout=300
allow arguments=1
allow nasty characters = 1
  • Message #2702

    Not intentionally, but I have vague memory thinking I should remove it... but that is for 0.4.2 or 0.4.4 I think...

    What do you use it for?

    The plan is to extend the command line syntax (think listpdh) to be a bit nicer (think wmi-modules in 0.4.0). The idea is to make command line syntax remotable in 0.4.2 or 0.4.4 depending on when I have the time...

    Michael Medin

    • Message #2707

      I will look for the new syntax in the next version. I used the listcounterinstances in one of our metrics software we used along side Nagios. Basically I'm querying the phiscial disk counter but the layouts are very different between our windows servers. So I queried the listCounterInstnace first to find the disk layout parsed that then queried the physical disk counter with each instance. My workaround was to use query the listCounterInstance with the integer value of the physical disk counter which is 234

      • Message #2719

        I have verified that this has been removed (in o.4.1).

        There is a new command line syntax which I could expose through nrpe if there is an interest?

        First check if this is usefull:

        nscp sys --help
        ...
        nscp sys --list --counter "Network Interface"
        

        There are a few potential solutions:

        1. add a "listInstance" command which does the exact same as before.
        2. add a generic "exee wrapper" which would allow you do to:
          check_nrpe -c exec -a pdh --list --counter "Network Interface"
          
        3. add a configurable alias thingy where you in the config can define which arguments are exposed (this would allow you to configure each)
          [...]
          listInstances=pdh --list --counter $ARG1$
          

        So which would be preferable?

        As a sidenote I might add that there are "more" commands exposed through the exec interface thus I think it would be nice to have the new "better syntax then the previous one?

        Michael Medin

Subscriptions