Java integration for collectd
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
etc add jet3t MBean filter Jan 28, 2009
src MBeanAttributeInfo.getDescriptor requires 1.6+ Mar 18, 2009
.classpath add junit Jan 30, 2009
LICENSE initial import Jan 14, 2009
README.markdown document typedb property Jan 29, 2009
build.xml bump version Jan 15, 2009


jcollectd - Java integration for collectd


collectd is a lightweight, extensible system statistics gathering daemon written in C for performance and portability. In-process plugins can be written in C or Perl. Out-of-process plugins are executed on each collection interval or can put values via the unixsock plugin.


The jcollectd package implements the collectd protocol in Java, making it possible for Java applications to push data into collectd over the wire. A Java app can configure JMX MBean attributes to be collected, or use the Java client API directly.

The listener side of the protocol is also supported, including an implementation that registers JMX MBeans making it possible to view collectd data using a graphical tool such as jconsole.

There is no installation process for jcollectd, as all required files are self-contained in collectd.jar with no dependecies other than Java version 5 or higher. The command-line and java configuration options required to use the package are described below.


The MBeanReceiver class listens for collectd packets and publishes the data as JMX MBeans. A summary MBean is created to aggregate metrics, where the attributes values are the average across all instances. The MBeans can be viewed using a tool such as the standard jconsole. The MBeanReceiver can be started using the following command:

    java -jar collectd.jar


  • Listen on the default IPv4 multicast group

      java -jar collectd.jar -jconsole
  • Listen on the IPv4 unicast address and start jconsole attached locally to the collectd.jar process:

      java -Djcd.laddr= -jar collectd.jar -jconsole
  • Listen on the default IPv4 multicast group and allow remote JMX connections to RMI/TCP port 25826:

      java -jar collectd.jar
  • Connect to the MBeanServer example above from another machine:

      jconsole the-remote-hostname:25826


  • jcd.laddr - UDP listen address, the default is Example:

  • jcd.ifaddr - The multicast network interface, default is any. Example:

  • jcd.typesdb - collectd types database files, default is types.db from collectd.jar Example:

  • - Enable summary MBean aggregator, the default is true. Example:
  • - Filter displayed hosts using a regex, the default is .*. Example:|qa


Any Java application can be configured to publish MBean data without any code changes. The following example will push java.lang:* MBeans to the default collectd multicast group:

    java -Djcd.tmpl=javalang -javaagent:collectd.jar YourMainClass

Tomcat example:

    export CATALINA_OPTS="-Djcd.instance=hudson -Djcd.dest=udp:// -Djcd.tmpl=javalang,tomcat -javaagent:collectd.jar"
    ./bin/ start


The jcd.* properties can be defined as System properties or in the file:

  • jcd.dest - UDP destination(s), the default is Example:

  • jcd.tmpl - jcollectd.xml MBean filter templates (see etc/). Example:

  • - The collectd host (Hostname in collectd.conf) defaults to InetAddress.getLocalHost().getHostName(). Example:
  • jcd.instance - The collectd Plugin Instance, defaults to java.lang:type=Runtime:Name. Example:

  • jcd.beans - ObjectName(s) which are not defined in a filter template. The ObjectName can be a pattern or fully qualified. Multiple ObjectNames are delimited using #. All attributes for the matching MBeans will be collected where the attribute value is a Number. Example:

  • - Path to the file which can be used to define all of the above properties. Example:

XML MBean filters

The MBean filters provide a way to define exactly which MBean attributes should be collected, how they should be named in collectd and what type the metric is. See the etc/ directory for examples. The format is currently subject to change pending feedback and documentation will follow.


See Also


Copyright (c) 2009 Hyperic, Inc. - See LICENSE

For feedback and discussion, please use collectd's mailinglist: collectd at