A Blog

An occasional data tap into Peter Burkholder’s brain

JMX - Collectd - Graphite

| Comments

I finally started sending some key JMX stats into Graphite via our collectd setup. A few notes since I’ll probably forget all about this until I next need to configure this.

JMX

JMX listens on a random port. Ended up adding all of the following to JAVA_OPTS

-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=19876

What objects and attributes are available to monitor? Enable jmxproxy in tomcat with the following in /etc/tomcat7/tomcat-users.xml

and then peruse http://localhost:8080/manager/jmxproxy/

collectd

Configured the plugin with Miah’s chef-collectd cookbook. See my recipe and the template at:

https://gist.github.com/pburkholder/8341458

The main changes to the plugin configuration is a change to prefix for the thread_pools and the ‘Type’ for class loading.

carbon-writer

We use the carbon-writer plugin from Gregory Szorc. The plugin didn’t sanitize out double-quotes, which pretty much horked the Graphite browser. This pull request fixes that.

debugging collectd

The Ubuntu build doesn’t include debugging so turning up the log level to ‘’debug’ does nothing. And the ’‘info’ level gives you almost nothing. The most useful steps for tracking down my issues (which came down to the aforementioned double-quote) was a) running in the foreground:

/usr/sbin/collectd -f -C /etc/collectd/collectd.conf

and enabling the CSV plugin to see what was getting written before going to carbon/graphite.

LoadPlugin csv DataDir “/var/lib/collectd/csv” StoreRates false