Menu

Counter containing \ in instance name

Help
robinm
2009-07-29
2013-04-25
  • robinm

    robinm - 2009-07-29

    I'm having trouble getting information for an MSMQ counter via NC_Net (v.4.4). I've run a couple of tests and I think it's down to the \ in the counter instance.

    For example, I specified the counter name as "\MSMQ Queue(servername)\Messages in Queue"

    The resulting error from NC_Net was:

    Exeption occured during Counter check :Instance 'servername' does not exist in the specified Category.::>\MSMQ Queue(servername)\Messages in Queue
    In that case, it can't find the counter instance.

    Then I specified "\MSMQ Queue(servername\test1)\Messages in Queue":

    Exeption occured during Counter check :Could not locate Performance Counter with specified category name 'MSMQ Queue', counter name 'test1)\Messages in Queue'.::>\MSMQ Queue(servername\test1)\Messages in Queue
    In that case, it can't find the counter.

    NC_Net seems to be parsing incorrectly?

     
    • tony

      tony - 2009-07-30

      It is strongly recomended to use the alternate syntex for the input arguments of COunters using ^ as a delimiter For example:
      -l "^MSMQ Queue^servername^Messages in Queue"
      Testing check_nt from consol until you get the syntex,
      once you get the syntex correct on the command line, then the next step is to escape the special characters like \ \and $$

      the biggest issues with the \ is usually that you need to escape it with an aditional \ for each one,
      the second biggest issue is the quotes " sometimes get droped between the command and the config file thus check_nt and check_nc_net do not recieve the full -l since the " are stripped before the command reaches it.

      To resolve this I put the " in the command definition instead of the service definitions.
      for example:
      ./check_nt  ....   -l"$ARGX$"

      Tony

       
      • robinm

        robinm - 2009-07-30

        Works perfectly, thanks

         

Log in to post a comment.