REST/JMX Bridge
At Polar Rose we use Cacti to monitor all our servers and services. Cacti is a simple tool that makes nice graphs of things like disk space used, bandwidth utilization or system load.
I wanted to use Cacti to keep track of some Java applications like ActiveMQ. Using JMX you can inspect applications pretty easily and get all kinds of good metrics out of them. Unfortunately JMX is pretty much a Java only thing and you have to talk to it through RMI. This is fine if you live in a 100% Java world but Cacti for example is a PHP app that just wants to call something unixy to get those values.
To make accessing JMX a little more simple I created a super small project called the JMX/REST Bridge. You can find it at Google Code where I host a lot of stuff that I write for Polar Rose.
The JMX/REST Bridge acts as a proxy between HTTP clients and JMX. Using a simple call HTTP GET you can fetch attributes from a specific object running on a server. There is zero security build in since we run this on a private network.
The JMX/REST Bridge home page has some examples. We use this now to obtain ActiveMQ metrics using a simple shell script that uses wget to make the calls. Cacti simply runs that every couple of minutes and turns it into fancy graphs. Sweet.
Later I intend to add a full REST API to this project so that it will be easy to fetch groups of values or even whole objects.
Created
