3 Replies Latest reply on Feb 19, 2010 12:32 PM by mazz

    Extending JMX plugin to monitor multiple mbeans?

    Mark Kempster Newbie

      I'm attempting to follow the jmx example mentioned http://management-platform.blogspot.com/2008/11/monitoring-custom-jmx-mbeans-with-jopr.html from the git source tree.

       

      http://git.fedorahosted.org/git/rhq/rhq.git?p=rhq/rhq.git;a=blob;f=etc/samples/custom-jmx-plugin/src/main/resources/META-INF/rhq-plugin.xml;h=acebe4f9037649262036145e254951accb6d5db2;hb=master

       

      seems to indicate that one service block should relate to one mbean, with each service/mbean able to display multiple metrics.

       

      I've been successful deploying a plugin that defines a single service element in rhq-plugin.xml, as in the example, but when I add a second service, the second one doesn't show up.

       

      Is it possible to define a single plugin that extends the JMX plugin, and ask it to monitor metrics from multiple mbeans?

       

      Thanks for your help!

      Mark

        • 1. Re: Extending JMX plugin to monitor multiple mbeans?
          Mark Kempster Newbie

          Forgot to mention... This plugin is deployed to an agent intent on monitoring jboss-as-5.1.0.GA. After importing the agent with a top-level O/S monitor, I manually add the JMX Server plugin with these properties:

           

          - Type: JBoss

          - Connector Address: jnp://127.0.0.1:1099 (the default for the JBoss type)

          - Additional Class Path Entries: C:/servers/jboss-5.1.0.GA/client/*.jar

           

          The "Java VM" node shows up in the tree, and does start collecting memory info. The first mbean listed in the rhq-plugin.xml is listed appropriately, but the second one in the rhq-plugin.xml isn't listed.

           

          Thanks.

          • 2. Re: Extending JMX plugin to monitor multiple mbeans?
            Mark Kempster Newbie

            Is it gauche to respond to oneself too many times?

             

            The missing component seems to have been the 'runs-inside' element, which should be present in every service element. Goofed that up good! Here's my current element structure, which shows the JVM Memory metrics from the JMX base plugin, and then one iterm per service with graphs of metrics from custom mbean properties.

             

            <plugin ..>

              <service ..>

                <runs-inside><parent-resource-type /> </runs-inside>

                <plugin-configuration><c:simple-property name="objectName" /></plugin-configuration>

                <metric .../>

              </service>

              <service ..>

                <runs-inside><parent-resource-type /> </runs-inside>

                <plugin-configuration><c:simple-property name="objectName" /></plugin-configuration>

                <metric .../>

              </service>

            </plugin>

             

            Thanks for making such an extensible plugin!

            • 3. Re: Extending JMX plugin to monitor multiple mbeans?
              mazz Master

              > Is it gauche to respond to oneself too many times?

               

              I talk to myself all the time :}