JBoss.org Community Documentation

- Prev

## Chapter 6. JMX monitoring with RHQ/JON

## 6.1. Introduction

The Drools engine supports runtime monitoring through JMX standard MBeans. These MBeans expose configuration and metrics data, from live knowledge bases and sessions, to internal details like rule execution times. Any JMX compatible console can be used to access that data. This chapter details how to use RHQ/JON to do it, but similar steps can be used for any other console.

### 6.1.1. Enabling JMX monitoring in a Drools application

To enable JMX monitoring in a Drools application, it is necessary to enable remote monitoring in the JVM. There are several tutorials on how to do that in the internet, but we recommend that you check the documentation of your specific JVM. Using the Oracle/Sun JVM, it can be as simple as running the engine with a few command line system properties.

For instance, to enable remote monitoring on port 19988 with disabled authentication (should be only used for tests/demos, as in production authentication should be enabled), just run the application with the following command line parameters:

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

The second step is to enable the Drools MBeans. As any Drools configuration, that can be done by setting a system property, or adding the property to a configuration file, or using the API.

To enable it in the command line, use:

     -Ddrools.mbeans=enabled

To enable id using the API, use:

     KnowledgeBaseConfiguration conf = ...

     conf.setOption( MBeansOption.ENABLED );

### 6.1.2. Installing and running the RHQ/JON plugin

The following sequence of steps can be used to configure JON to monitor a Drools application:

1. Download the JON server and agent.

2. Download Drools plugin included in the "Drools and jBPM tools" bundle (http://www.jboss.org/drools/downloads.html).

3. Install server, agent, and the plugin.

4. Check that the server is running, agent is running and plugin is installed.

5. Execute the drools application [see details in the previous section].

6. On the agent console, type "discovery" command for the agent to find the drools application, which it will find on port 19988.

7. On JON console, click on auto-discovery queue.

8. Select the JMX Server process that is showing there, running on port 19988.

9. Click import.

10. Click on Resources->servers.

11. Click on the JMX Server.

12. Under JMXServer on the left hand side, you have Drools Service.

- PrevChapter 5. OSGi Integration
- Top of page
- Front page