12.2. Kodo Management Console
Prev | Chapter 12. Management and Monitoring | Next

## 12.2. Kodo Management Console

The Kodo Management Console is used for local and remote management of MBeans. It can be used to connect to a local MBean server or multiple remote MBeanServers. To connect to a local server, see Section 12.1, “Configuration”.

### 12.2.1. Remote Connection

To start the Kodo Management Console for remote management, run the `remotejmxtool` command. The `remotejmxtool` accepts the following arguments:

- -connect/-c: Whether to attempt an initial connection to the remote JMX adaptor. Defaults to false.

- -type/-t: The type of the remote JMX adaptor. Current supported types are `mx4j`, `weblogic81` and `jboss`. Defaults to `mx4j`. Integration with other JMX server implementations that support remote connectivity can be accomplished by creating a class that implements the `RemoteMBeanServerFactory` interface. In this case, the `type` should be the fully qualified name of the implementing class.

- -host/-h: Hostname of the JNDI service provider where the remote JMX adaptor is registered. Defaults to `localhost`. When attempting an initial connection to WebLogic, this must be set to a hostname of the form `username:password@hostname`.

- -port/-p: Port of the JNDI service provider where the remote JMX adaptor is registered. Defaults to `1099` when connecting to MX4J. Defaults to `7001` when connecting to WebLogic.

- -name/-n: The JNDI name of the remote JMX adaptor. Defaults to a special value `default` which yeilds the default JNDI name appropriate for the chosen remote JMX adaptor type. For MX4J, the default is `jrmp`, and for JBoss, the default is the first available JMX adaptor available at the specified JNDI service provider. For WebLogic, this parameter is ignored.

For example, to automatically connect to the MX4J remote JMX adaptor on host `myhost.mydomain.com`, use the following command:

    remotejmxtool -c -host myhost.mydomain.com

Once `remotejmxtool` is up, you can connect to multiple remote JMX adaptors. To connect to Kodo with MX4J, select `Connect to Kodo JMX...` from the `File` menu. To connect to Kodo running under WebLogic, select `Connect to Kodo via WebLogic JMX...` from the `File` menu. To connect to Kodo running under JBoss, select `Connect to Kodo via JBossMX...` from the `File` menu.

#### 12.2.1.1. Connecting to Kodo under WebLogic 8.1

In order to connect to WebLogic 8.1 with `remotejmxtool`, the following requirements must be met:

- `remotejmxtool` must be run with the `weblogic.jar` (found in the `weblogic81/server/lib/` directory of the WebLogic 8.1 distribution) in your `CLASSPATH`. Note that this library should appear before the `mx4j-jmx.jar` (included with the Kodo distribution) library in your `CLASSPATH`.

- The `remotejmxtool` must be run with JDK 1.4.x.

- The jar `kodo-wl81manage.jar` must be put in the WebLogic system `CLASSPATH`. You can accomplish this by editing `startWebLogic.sh/.cmd`.

#### 12.2.1.2. Connecting to Kodo under JBoss 3.2

In order to connect to JBossMX 3.2, `remotejmxtool` must be run with the following libraries from the JBoss distribution in your `CLASSPATH`.

- `jboss-common-client.jar`: Found in the `client/` directory of the JBoss 3.2 distribution.

- `jboss-jmx.jar`: Found in the `lib/` directory of the JBoss 3.2 distribution.

- `jmx-adaptor-plugin.jar`: Found in the `server/all/lib/` directory of the JBoss 3.2 distribution.

- `jnp-client.jar`: Found in the `client/` directory of the JBoss 3.2 distribution.

- `jboss-system.jar`: Found in the `lib/` directory of the JBoss 3.2 distribution.

- `jnet.jar`: Found in the `client/` directory of the JBoss 3.2 distribution. Alternately, `remotejmxtool` can be run under JDK 1.4 or higher.

- `concurrent.jar`: Found in the `client/` directory of the JBoss 3.2 distribution.

- `jbossall-client.jar`: Found in the `client/` directory of the JBoss 3.2 distribution.

Note that these libraries should appear before the `mx4j-jmx.jar` (included with the Kodo distribution) library in your `CLASSPATH`.

### 12.2.2. Using the Kodo Management Console

The above diagram shows the Kodo Management Console window. The Kodo Management Console window is divided into two main parts, the `JMX Explorer` on the left, and the `MBean Panel` on the right.

#### 12.2.2.1. JMX Explorer

The `JMX Explorer` provides a tree view of the connected MBeanServers. Under each MBeanServer are the JMX domains handled by that server. Under each domain are the MBeans within that domain. Under each MBean are the Attributes, Operations and Notifications provided by that MBean.

##### 12.2.2.1.1. Executing Operations

In order to execute an Operation of an MBean, right click on the Operation, and select "Execute..." from the context menu. A dialog box will come up asking for values for each of the arguments to the managed Operation. Fill in each of the values and hit the `OK` button to execute the Operation.

| Note
Currently, only primitive types, primitive wrapper types and classes for which there is a constructor that takes a single String argument can be entered.

If the Operation returns a non-null value, the string representation of the return value will be shown.

##### 12.2.2.1.2. Listening to Notifications

When an MBean is selected in the `JMX Explorer`, the Kodo Management Console automatically listens to all Notifications. To stop listening to all Notifications for a given MBean, right click on the `Notifications` node and select `Stop Listening All`. To stop listening to a single Notification, right click on the individual Notification and select `Stop Listening`. In order to listen to all Notifications provided by an MBean, right click on the `Notifications` node under the MBean and select `Listen All`. To listen to a single Notification, right click on the individual Notification and select `Listen`.

The available Notifications can be seen in the `MBean Panel` to the right of the `JMX Explorer`.

#### 12.2.2.2. MBean Panel

The Attributes, Operations and Notifications of an MBean can be viewed in the `MBean Panel`. The top half of the panel shows Notifications and statistics, while the bottom half allows for viewing / editing Attributes, viewing available Operations, and viewing available Notifications.

##### 12.2.2.2.1. Notifications / Statistics

The top half of the `MBean Panel` shows the Notifications emitted by the selected MBean. Note that Notifications must be listened to (see Section 12.2.2.1.2, “Listening to Notifications”) in order to be viewed in the `MBean Panel`. There is one tab per Notification. Certain Notifications represent statistics. These Notifications are grouped under tabs based on their ordinate description. Statistic Notifications are represented in charts. Dragging a rectangle across a chart causes the chart to zoom in on the selected area. Right clicking on a chart brings up a context menu with a number of options:

- Properties...: Edit chart properties, such as colors and labels.

- Save as...: Save the chart to disk.

- Print...: Print the chart.

- Zoom In / Zoom Out: Zoom in and out on either or both axes.

- Auto Range: Set the either or both the abscissa and ordinate range to see all of the values.

##### 12.2.2.2.2. Setting Attributes

The `Attributes` tab in the bottom half of the `MBean Panel` allows for viewing / editing of Attributes. Not all Attributes are editable. Selecting an editable Attribute allows you to set the value.

| Note
Currently, only primitive types, primitive wrapper types and classes for which there is a constructor that takes a single String argument can be entered.

Prev | Up | Next
Chapter 12. Management and Monitoring | Home | 12.3. Accessing the MBeanServer from Code