3 Replies Latest reply on Jun 10, 2014 7:00 PM by raylite3

    Datatypes supported by JMX plugin

    raylite3

      Hello,

      I created a simple custom JMX plugin using the org.rhq.plugins.jmx.MBeanResourceComponent/MBeanResourceDiscoveryComponent.

       

      And it works fine for a property that is a number like a count. Can I also specify a string value like a status and use it for the availability check ? Would I specify that datatype as a 'trait' ? I don't see this property (in the Monitoring tab) when I specify it as a 'trait'.


      I also have a CacheMBean that returns a CacheStat object for one of its attributes. Can I use one of the fields within this CacheStat object as my metric?

       

      Thanks.

        • 1. Re: Datatypes supported by JMX plugin
          tsegismont

          I'm not sure I get you. Can you post your custom plugin descriptor? With MBeanResourceComponent, availability is determined by the mere presence of the MBean.

          • 2. Re: Datatypes supported by JMX plugin
            genman

            You can look at a trait and then alert if the trait value changes.

             

            If the MBean returns a custom class, the agent will basically turn it into a string, but unless the agent has your class it won't be able to deserialize it from a call.

             

            Have CacheStat implement javax.management.openmbean.CompositeData ; you can then extract a property from it. E.g.

             

                        <metric displayName="Used"

                                property="{Usage.used}"

                                displayType="summary"

                                description="Current memory usage"

                                units="bytes"/>


            Where Usage is the MBean attribute 'Usage' and used is the field from it.

            • 3. Re: Datatypes supported by JMX plugin
              raylite3

              Thanks