[Download] | [Documentation Index] | [Release Note]

JMX Based Monitoring

Contents

Introduction

Java Management Extensions (JMX) is a technology that lets you implement management interfaces for Java applications. A management interface, as defined by JMX, is composed of named objects - called MBeans (Management Beans). MBeans are registered with a name (an ObjectName) in an MBeanServer. To manage (a) resource(s) in your application, you will write an MBean that defines its management interface, and then register that MBean in your MBeanServer. The content of the MBeanServer can then be exposed through various protocols, implemented by protocol connectors, or protocol adaptors. The first version of JMX based monitoring is available in this release. Some of the monitoring & management capabilities available in the Management Console have also been exposed via JMX.

Using jconsole to Manage & Monitor AppServer

This section introduces some of the MBeans in AppServer and their usages. We will use jconsole which ships with J2SDK 1.5 and newer version in the course of this documentaton.

JMX is by default enabled in WSO2 Carbon. You can change the JMX configuration by editing the jmx.xml file which is inside CARBON_HOME/repository/conf/advanced/ directory.

You can configure JMX ports, RMIRegistryPort and RMIServerPort from the "Ports" section of the carbon.xml (inside CARBON_HOME/repository/conf) as follows.

        <JMX>
        <!--The port RMI registry is exposed-->
        <RMIRegistryPort>9999</RMIRegistryPort>
        <!--The port RMI server should be exposed-->
        <RMIServerPort>11111</RMIServerPort>
        </JMX>
    

If JMX is enabled, when the server starts up, it will print the JMX Server URL on the console as follows.

        INFO {org.wso2.carbon.core.init.CarbonServerManager} -  JMX Service URL  : service:jmx:rmi://<your-ip>:11111/jndi/rmi://<your-ip>:9999/jmxrmi
    

Now go to the command prompt and you can start Jconsole by using the command 'jconsole'

As shown in the above image, you can connect to Carbon by providing the above URL as the Remote Process URL. You can type in the default username and password combination admin/admin to login. Note that this is the same administrator account that is used for looging in, in the Management Console. Any user having the admin role can login to JMX.


Here is the first window you will see when you login.


Click on the MBeans tab and you will see the org.wso2.carbon domain, which will contain some MBeans as shown below.

ServerAdmin MBean

The ServerAdmin MBean is used for administering the AppServer server instance

The above screen shows the Server attributes such as the ServerStatus, ServerData & ServerVersion. The ServerStatus can be either RUNNING, SHUTTING_DOWN, RESTARTING or IN_MAINTENANCE.


The above screen shows the operations available in the ServerAdmin MBean.

ServiceAdmin MBean

The ServiceAdmin MBean is used for adminsitering services deployed on AppServer The above screen shows the attributes:
The above screen shows the operations available in the ServiceAdmin MBean.

Statistics MBean

The Statistics MBean is used for monitoring system and server statistics The above screen shows the attributes:
The above screen shows the operations available in the Statistics MBean.