[collectd] generic JMX plugin

Florian Forster octo at verplant.org
Tue Jul 28 08:54:15 CEST 2009


Hi Matt,

On 7/27/09 3:01 PM, matthew sporleder wrote:
> I have a pretty strong need to do some java monitoring and,
> unfortunately, I can't get all of the information I need through the
> jvm's built-in snmp interface.  (all the memory info is there, but I
> don't think I can get database thread pools, message queue depths,
> hibernate stats, etc)
>
> So what I would really like to see is an snmp-style plugin that spoke JMX.

I think there are two possible and elegant solutions:

  - jcollectd [0], a pure-Java implementation of the collectd network
    protocol. It can be attached to a Java process to transparently
    collect JMX information and submit it to a collectd instance. I'm
    CC'ing Doug, author of jcollectd, in case he has some clever advice
    for us :)

  - Write a generic JMX plugin in Java, using the collectd Java
    bindings [1]. My preferred solution would be to use the same
    configuration as jcollectd (or at least something very similar), so
    that they can share the configuration code.

> Define the<Data>  to collect in terms of the mbean domain, mbean name,
> and attribute name
> Then a type, obviously, and the Table feature would be pretty handy as
> well for getting values that come back in lists.  (although specifying
> the specific value to get would also be fine)
> committed=1532428288, init=1610612736, max=1532428288, used=974726808
> (just part of a javax.management.openmbean.CompositeData jmx answer
> from mx4j.  Don't even get me started on trying to use the curl plugin
> on that)

I have to admit I don't understand half of that. Unfortunately all those
Java technologies have their own slang that is impossible to understand
as an outsider. It took me like half a day to figure out a “service URL”
that worked for me when I was writing that “JMXMemory” sample plugin.

> <Data "javaoldgen">
>   Type "javax.management.openmbean.CompositeData"
>   Table true
>   MBdomain "java.lang"
>   MBname "type=MemoryPool,name=PS Old Gen"
>   MBattribute "Usage"
> </Data>

The jcollectd configuration looks somewhat like this (it's a Tomcat
example config):

-- 8< --
 <jcollectd-config>
   <mbeans name="tomcat">
     <mbean name="Catalina:type=GlobalRequestProcessor,*" alias="GRP">
       <attribute name="bytesReceived" alias="received" units="bytes" type="counter"/>
       <attribute name="bytesSent" alias="sent" units="bytes" type="counter"/>
       <attribute name="errorCount" alias="errors" type="counter"/>
     </mbean>
   </mbeans>
 </jcollectd-config>
-- >8 --

Regards,
-octo

[0] <http://support.hyperic.com/display/hypcomm/jcollectd>
[1] <http://collectd.org/wiki/index.php/Plugin:Java>
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20090728/a4369f21/attachment.pgp 


More information about the collectd mailing list