Friday, August 15, 2008

RHQ monitor arbitrary JMX servers (Eclipse as example)

While RHQ is focusing on providing specific resource types with specific operations and metrics on them, it is possible to just connect to any JMX server (actually that code is in SVN Head as of today).

This example will show you how you could use this to e.g. monitor your Eclipse instance. This basically consists of two steps:

instrument the target app -- Eclipse in this case

manually add a JMX server to the RHQ inventory

Step 1: instrument Eclipse

Add the following to eclipse.ini:

-Dcom.sun.management.jmxremote

-Dcom.sun.management.jmxremote.port=10000

as we don't want for this example password authentication and ssl (of course you should do that for production, but we want to concentrate on how to initiate the connection at all), we disable it by supplying