Ad Widget

Collapse

JMX and TabularData

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Doug212
    Junior Member
    • Jan 2015
    • 3

    #1

    JMX and TabularData

    Hi all,

    We have been using JMX in a basic way since Zabbix 2.0 via the JMX gateway without a problem. We have used simple queries as well as queries against CompositeData structures. However, I now have a JMX bean to query that returns a very complex set of information using a TabularData interface. I haven't figured out how to query anything whatsoever in this via JMX.

    I will share the output from jmxterm so you can see the structure. (I have removed all but the first two entries in each array to save space.)

    In short, I want to get, at least, the "QueueSize" for a given "ExecutorName". The executor names are CQP, PGO, PGQ, and PMQ.

    JConsole shows those up as 4 "Tabular Navigation" items under the "ExecutorDetails" attribute of the MBean.

    Within each of those four is an array of 8-16 more values. JConsole also allows those to be scrolled using "Tabular Navigation." In each of these 8-16 entries there are things like CompletedTasksCount, QueueSize and Thread. What I want is QueueSize, which is the same for each "ExecutorName", so I don't really care which array entry it comes from.

    I can't figure out the jmx[...] query to use. I figure it is something like this:

    jmx["X.Y.Z:type=GroupExecutorService,name=ExecutorsDet ails","????"]

    ...but I don't know what the ??? should be.

    Please help? Many thanks!

    Cheers,

    Doug

    Code:
    $>bean X.Y.Z:type=GroupExecutorService                      
    #bean is set to X.Y.Z:type=GroupExecutorService
    $>info                                         
    #mbean = X.Y.Z:type=GroupExecutorService
    #class name = X.Y.Z.common.jmx.GroupExecutorServiceJmxFacade
    # attributes
      %0   - ExecutorsDetails (javax.management.openmbean.TabularData, r)
    # operations
      %0   - javax.management.openmbean.TabularData getExecutorsDetails()
    #there's no notifications
    $>get ExecutorsDetails
    #mbean = X.Y.Z:type=GroupExecutorService:
    ExecutorsDetails = { 
      ( PGQ, { 
        ( 1, 0 ) = { 
          CompletedTasksCount = 138865;
          QueueSize = 0;
          Thread = 1;
         };
        ( 2, 0 ) = { 
          CompletedTasksCount = 239811;
          QueueSize = 0;
          Thread = 2;
         };
       } ) = { 
        ExecutorDetails = { 
          ( 1, 0 ) = { 
            CompletedTasksCount = 138865;
            QueueSize = 0;
            Thread = 1;
           };
          ( 2, 0 ) = { 
            CompletedTasksCount = 239811;
            QueueSize = 0;
            Thread = 2;
           };
         };
        ExecutorName = PGQ;
       };
      ( CQP, { 
        ( 1, 0 ) = { 
          CompletedTasksCount = 241687;
          QueueSize = 0;
          Thread = 1;
         };
        ( 2, 0 ) = { 
          CompletedTasksCount = 437325;
          QueueSize = 0;
          Thread = 2;
         };
       } ) = { 
        ExecutorDetails = { 
          ( 1, 0 ) = { 
            CompletedTasksCount = 241687;
            QueueSize = 0;
            Thread = 1;
           };
          ( 2, 0 ) = { 
            CompletedTasksCount = 437325;
            QueueSize = 0;
            Thread = 2;
           };
         };
        ExecutorName = CQP;
       };
      ( PMQ, { 
        ( 1, 0 ) = { 
          CompletedTasksCount = 240052;
          QueueSize = 0;
          Thread = 1;
         };
        ( 2, 0 ) = { 
          CompletedTasksCount = 434979;
          QueueSize = 0;
          Thread = 2;
         };
       } ) = { 
        ExecutorDetails = { 
          ( 1, 0 ) = { 
            CompletedTasksCount = 240052;
            QueueSize = 0;
            Thread = 1;
           };
          ( 2, 0 ) = { 
            CompletedTasksCount = 434979;
            QueueSize = 0;
            Thread = 2;
           };
         };
        ExecutorName = PMQ;
       };
      ( PGO, { 
        ( 1, 0 ) = { 
          CompletedTasksCount = 289;
          QueueSize = 0;
          Thread = 1;
         };
        ( 2, 0 ) = { 
          CompletedTasksCount = 315;
          QueueSize = 0;
          Thread = 2;
         };
       } ) = { 
        ExecutorDetails = { 
          ( 1, 0 ) = { 
            CompletedTasksCount = 289;
            QueueSize = 0;
            Thread = 1;
           };
          ( 2, 0 ) = { 
            CompletedTasksCount = 315;
            QueueSize = 0;
            Thread = 2;
           };
         };
        ExecutorName = PGO;
       };
     };
  • Doug212
    Junior Member
    • Jan 2015
    • 3

    #2
    I fixed it

    Well, nobody seemed able to help, so I dove into the source code and fixed it myself.

    I submitted the patch to the Zabbix team here:



    Cheers,

    Doug

    Comment

    • dimir
      Zabbix developer
      • Apr 2011
      • 1080

      #3
      This will be fixed here: https://support.zabbix.com/browse/ZBX-23948 (planned for 7.0)

      Comment

      Working...