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:

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

and restart Eclipse afterwards.

This page at Sun explains the various options for JMX remoting in JDK5.

Step 2: Manually add a JMX server in RHQ

Go to the inventory tab of the platform and select "Manually Add": "Jmx Server" below the list of child resources. Press OK


On the next screen select "JDK 5" from the drop down and continue:


The following screen will show prefilled connection properties - here we need to set port 10000 from above:


Click on OK and the new Java VM should appear. After some waiting, you will see the inidividual MBeans as you know it from other services in RHQ:


Technorati Tags:

1 comment:

berggeist said...

Is ist possible to call custom MBean operations without writing a plugin?