I was writing a question but I found it out while writing, so I'm leaving this for documentation purpose :P
I have some server running Jboss AS 7. I can connect to it's jmx interface via jconsole adding some jar in the classpath
java \
-Djmxtrans.log.dir=. \
-cp \
/usr/share/jmxtrans/jmxtrans-all.jar:\
/usr/lib/jvm/java-7-oracle/lib/jconsole.jar:\
/usr/lib/jvm/java-7-oracle/lib/tools.jar:\
/home/vagrant/torquebox-2.3.2/jboss/modules/org/jboss/remoting3/remoting-jmx/main/remoting-jmx-1.0.5.Final.jar:\
/home/vagrant/torquebox-2.3.2/jboss/modules/org/jboss/remoting3/main/jboss-remoting-3.2.12.GA.jar:\
/home/vagrant/torquebox-2.3.2/jboss/modules/org/jboss/logging/main/jboss-logging-3.1.2.GA.jar:\
/home/vagrant/torquebox-2.3.2/jboss/modules/org/jboss/xnio/main/xnio-api-3.0.7.GA.jar:\
/home/vagrant/torquebox-2.3.2/jboss/modules/org/jboss/xnio/nio/main/xnio-nio-3.0.7.GA.jar:\
/home/vagrant/torquebox-2.3.2/jboss/modules/org/jboss/sasl/main/jboss-sasl-1.0.3.Final.jar:\
/home/vagrant/torquebox-2.3.2/jboss/modules/org/jboss/marshalling/main/jboss-marshalling-1.3.16.GA.jar:\
/home/vagrant/torquebox-2.3.2/jboss/modules/org/jboss/marshalling/river/main/jboss-marshalling-river-1.3.16.GA.jar:\
/home/vagrant/torquebox-2.3.2/jboss/modules/org/jboss/as/cli/main/jboss-as-cli-7.1.x.incremental.129.jar:\
/home/vagrant/torquebox-2.3.2/jboss/modules/org/jboss/staxmapper/main/staxmapper-1.1.0.Final.jar:\
/home/vagrant/torquebox-2.3.2/jboss/modules/org/jboss/as/protocol/main/jboss-as-protocol-7.1.x.incremental.129.jar:\
/home/vagrant/torquebox-2.3.2/jboss/modules/org/jboss/dmr/main/jboss-dmr-1.1.1.Final.jar:\
/home/vagrant/torquebox-2.3.2/jboss/modules/org/jboss/as/controller-client/main/jboss-as-controller-client-7.1.x.incremental.129.jar:\
/home/vagrant/torquebox-2.3.2/jboss/modules/org/jboss/threads/main/jboss-threads-2.0.0.GA.jar:\
/home/vagrant/torquebox-2.3.2/jboss/modules/org/jboss/as/controller/main/jboss-as-controller-7.1.x.incremental.129.jar \
com.googlecode.jmxtrans.JmxTransformer -e -f /home/vagrant/test.json -s 60
/home/vagrant/test.json
{
"servers" : [ {
"queries" : [ {
"obj" : "java.lang:type=OperatingSystem",
"attr" : [ "SystemLoadAverage", "AvailableProcessors", "TotalPhysicalMemorySize",
"FreePhysicalMemorySize", "TotalSwapSpaceSize", "FreeSwapSpaceSize",
"OpenFileDescriptorCount", "MaxFileDescriptorCount" ],
"outputWriters" : [ {
"@class" : "com.googlecode.jmxtrans.model.output.StdOutWriter",
"settings" : {}
} ]
} ]
} ]
}
Maybe I will end up writing jmxtrans elasticsearch output to save me the trouble of parsing stdout with logstash filter