Ad Widget

Collapse

Format of JMX keys that contain double quotes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tmcleod
    Junior Member
    • Jul 2012
    • 15

    #1

    Format of JMX keys that contain double quotes

    Hello,

    I want to use Zabbix to monitor the length of various queues in HornetQ. I have enabled JMX monitoring on the host in question and have confirmed that it is working.

    My key looks like this:

    jmx["org.hornetq:module=JMS,type=Queue,name=Ares",Cons umerCount]

    where the object name is everything between the "" marks and ConsumerCount is the attribute I want to monitor.

    The problem is that there are supposed to be double quote (")marks around Ares in the Object name. If I include them, I get a syntax error. If I leave them out, I get a status of "not supported" on the host's items screen.

    Anyone know the correct syntax for a JMX key where the object name includes double quotes?

    Thanks,
    Trevor
  • tchjts1
    Senior Member
    • May 2008
    • 1605

    #2
    Originally posted by tmcleod
    Hello,

    I want to use Zabbix to monitor the length of various queues in HornetQ. I have enabled JMX monitoring on the host in question and have confirmed that it is working.

    My key looks like this:

    jmx["org.hornetq:module=JMS,type=Queue,name=Ares",Cons umerCount]

    where the object name is everything between the "" marks and ConsumerCount is the attribute I want to monitor.

    The problem is that there are supposed to be double quote (")marks around Ares in the Object name. If I include them, I get a syntax error. If I leave them out, I get a status of "not supported" on the host's items screen.

    Anyone know the correct syntax for a JMX key where the object name includes double quotes?

    Thanks,
    Trevor
    Try also adding quotes around ConsumerCount as shown here:
    "org.hornetq:module=JMS,type=Queue,name=Ares","Con sumerCount"]

    Comment

    • tmcleod
      Junior Member
      • Jul 2012
      • 15

      #3
      Adding quotes around ConsumerCount did not resolve the problem. What actually worked was to escape each set of double quotes around Ares with the "\" character.

      Trevor

      Comment

      • vrtareg
        Senior Member
        • May 2006
        • 293

        #4
        Hi

        Do you mean something like

        Code:
        jmx[Standalone:type=ThreadPool,name=\"ajp-nio2-{#JMXVALUE}\",currentThreadCount]
        I am trying to prototype JMX monitoring and look like I am getting final item like
        Code:
        jmx[Standalone:type=ThreadPool,name=\"ajp-nio2-8605\",currentThreadCount]
        and it does not work ...

        Code:
        error reason for "confluence-n2:jmx[Standalone:type=ThreadPool,name="ajp-nio2-8605",currentThreadCount]" changed: required key format: jmx[<object name>,<attribute name>]
        Any idea what I am doing wrong?

        Zabbix Server 3.0.2

        Regards,
        Areg

        Comment

        • Pada
          Senior Member
          • Apr 2012
          • 236

          #5
          From http://blog.zabbix.com/putting-dots-...nitoring/1673/
          If the object name or attribute name contains spaces or commas, double-quote it:
          What they don't tell you is if there is a double-quote in the object or attribute name, in which case you need to wrap the whole object or attribute name in double-quotes and then escape the inner double-quotes with a \

          For example, if the object name is like:
          Code:
          Catalina:type=GlobalRequestProcessor,name="http-nio-8443"
          Then your key should be like:
          Code:
          jmx["Catalina:type=GlobalRequestProcessor,name=\"http-nio-8443\"",bytesReceived]
          The above worked for me with Zabbix 3.2.3

          Comment

          • vrtareg
            Senior Member
            • May 2006
            • 293

            #6
            Hi

            Yes I have figured it out.

            Lack of discovery on JMX makes monitoring quite problematic if you don't know which objects will be available and which are not. ...

            Regards,
            Areg

            Comment

            • Pada
              Senior Member
              • Apr 2012
              • 236

              #7
              OK great!

              Yes, it is a pain to get all the important JMX items. I'm now in the process of replacing our Zabbix 1.8 (with Zapcat) with a Zabbix 3.2 (with Java gateway).

              I typically hook up Zapcat (deployed on like tomcat) or use jConsole/jVisualVM to obtain the list of possible entries.
              Unfortunately the Zapcat development was stopped and it had a few issues, so I've made some updates to it too.

              I'm currently busy testing out https://github.com/RiotGamesMinions/zabbix_jmxdiscovery as an external script (which would reside on a Zabbix Proxy/Server) to aid my JMX discovery. So far I have this working to get like Hazelcast map names for me, and my next step would be to obtain the different Java garbage collector names, because they changed between Java 1.7 and Java 1.8 and depending on whether you have a single or multi-core host.

              I'm also using the script from https://www.zabbix.org/wiki/Docs/howto/zabbix_get_jmx to quickly test whether I have the object and attribute names correct for Zabbix. Unfortunately they now broke that script with Zabbix 3.2.3 (ZBX-11528)

              Comment

              Working...