Announcement

Collapse
No announcement yet.

JMX metrics.. Help!

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    JMX metrics.. Help!

    Zabbix 3.2.4 (server)
    Zabbix 3.0.13 (revision 74336) (agent)


    I have been able to get the following information from JMX properly through a java gateway. All is good there..

    jmx[java.lang:type=Threading,DaemonThreadCount]
    jmx[java.lang:type=Threading,PeakThreadCount]
    jmx[java.lang:type=Threading,ThreadCount]
    jmx[java.lang:type=Memory,HeapMemoryUsage.used]


    But when I try and get some AJP statistics. I simply cannot get them...

    jmx[Standalone-user999:type=ThreadPool,currentThreadsBusy]
    jmx[Standalone-user999:type=ThreadPool,name=ajp-nio-8999,currentThreadsBusy]
    jmx[ajp-nio-8999:type=ThreadPool,currentThreadsBusy]
    jmx[Standalone-user999:name=ajp-nio-8999:type=ThreadPool,currentThreadsBusy]
    jmx[Standalone-user999:name=ajp-nio-8999,type=ThreadPool,currentThreadsBusy]
    jmx[Standalone-user999\ajp-nio-8999:type=ThreadPool,currentThreadsBusy]
    jmx[Standalone-user999\\ajp-nio-8999:type=ThreadPool,currentThreadsBusy]
    jmx[Standalone-user999:type=ThreadPool,currentThreadsBusy,name=aj p-nio-8999]
    jmx[*:type=ThreadPool,currentThreadsBusy,name=ajp-nio-8999]
    jmx[.*:type=ThreadPool,currentThreadsBusy,name=ajp-nio.*]
    jmx[Standalone\-user.*\|name=ajp\-nio\-.*\|type=ThreadPool:currentThreadsBusy]
    jmx["Catalina:type=ThreadPool,name=\"ajp-nio-8999\"",currentThreadCount]
    jmx["Catalina:type=ThreadPool,name=ajp-nio-8999",currentThreadCount]

    Thoughts?

    Thanks in advance.

    J

    #2
    (cough)

    (sneeze)

    Surely there is someone out there with JMX experience..

    Comment


      #3
      Yea, but when we got to the point where we got some JMX stats but not others, it was an issue on the Java end. In our case, the stats were for "something" that was HA and only active on one host at a time. That host would respond with the items and the others wouldn't. Of course, the items would stay unsupported for awhile after the "something" migrated to another host so stats were sluggish.

      Since this wasn't by far the biggest problem the Java app owners had we didn't try to fix it.

      Comment


        #4
        Originally posted by LenR View Post
        Yea, but when we got to the point where we got some JMX stats but not others, it was an issue on the Java end.
        Hmmm.. We had a tool that we demoed that displayed the JMX stats no problem.. I don't think it's an issue with the application. When I run the discovery command I can see what I am looking for in the discovery response... I think it's a matter or finding the right pattern for getting the information out but I also feel like I have tried everything...

        Thanks,
        J

        Comment


          #5
          I found this very useful:

          https://www.zabbix.com/forum/showthread.php?t=36652

          Download jmxterm on the host you are monitoring. Run the commands as described. I did the same and got the jmx keys I wanted

          Comment


            #6
            That help me to understand how to find the beans in JMX. Now I having trouble constructing them into something zabbix can understand.

            $>domain Standalone-user999
            #domain is set to Standalone-user999
            $>bean name="ajp-nio-8300",type=ThreadPool
            #bean is set to Standalone-user9999:name="ajp-nio-8300",type=ThreadPool
            $>get currentThreadsBusy
            #mbean = Standalone-user999:name="ajp-nio-8300",type=ThreadPool:
            currentThreadsBusy = 0;

            I can't seem to get this translated to a key.


            jmx["Standalone-user999:Type=ThreadPool,currentThreadsBusy"]

            Help?




            Originally posted by rv_overseer View Post
            I found this very useful:

            https://www.zabbix.com/forum/showthread.php?t=36652

            Download jmxterm on the host you are monitoring. Run the commands as described. I did the same and got the jmx keys I wanted

            Comment


              #7
              $>domains
              $>domain java.lang
              #domain is set to java.lang
              $>beans
              $>bean java.lang:name=PS\ Eden\ Space,type=MemoryPool
              #bean is set to java.lang:name=PS Eden Space,type=MemoryPool
              $>info
              #mbean = java.lang:name=PS Eden Space,type=MemoryPool
              #class name = sun.management.MemoryPoolImpl
              # attributes
              %9 - Type (java.lang.String, r)
              %10 - Usage (javax.management.openmbean.CompositeData, r)
              %11 - UsageThreshold (long, rw)
              $>get Usage

              Usage UsageThreshold UsageThresholdCount UsageThresholdExceeded UsageThresholdSupported
              $>get Usage
              #mbean = java.lang:name=PS Eden Space,type=MemoryPool:
              Usage = {
              committed = 4004511744;
              init = 1073741824;
              max = 11074011136;
              used = 3948406792;
              };


              So once you got these parts, then the jmx key is:
              jmx["java.lang:type=MemoryPool,name=PS Eden Space",Usage.used]

              Comment


                #8
                Yours should be:

                jmx["Standalone-user999:type=ThreadPool,name=ajp-nio-8300",currentThreadsBusy]
                Last edited by rv_overseer; 07-12-2017, 09:46. Reason: grammar

                Comment


                  #9
                  Originally posted by rv_overseer View Post
                  Yours should be:

                  jmx["Standalone-user999:type=ThreadPool,name=ajp-nio-8300",currentThreadsBusy]
                  Yeah I have tried that one.. I get "Standalone-user999:type=ThreadPool,name=ajp-nio-8300" not supported.

                  Comment


                    #10
                    jmx["Standalone-user999:type=ThreadPool,name=\"ajp-nio-8300\"","currentThreadsBusy"]

                    The above worked.. Then others failed.. I realized after some time that anything with a - (dash) in it must have quotes and anything that doesn't must not.. (shrugs)

                    Thanks for the help.

                    Comment

                    Working...
                    X