...
- Open a command prompt and navigate to the
<JDK_HOME>/bin
directory. - Execute the j
console
command to open the log-in screen of the Java Monitoring & Management Console as shown below. - Enter the connection details in the above screen as follows:
Enter the JMX server URL in the Remote Process field. This URL is published on the command prompt when you start the WSO2 server as explained above.
Info title Tip If you are connecting with a remote IP address instead of localhost, you need to bind the JMX service to the externally accessible IP address by adding the following system property to the product startup script stored in the
<PRODUCT_HOME>/bin
directory (wso2server.sh
for Linux andwso2server.bat
for Windows). For more information, read Troubleshooting Connection Problems in JConsole.Code Block -Djava.rmi.server.hostname=<IP_ADDRESS_WHICH_YOU_USE_TO_CONNECT_TO_SERVER>
Be sure to restart the server after adding the above property.
Enter values for the Username and Password fields to log in. If you are logging in as the administrator, you can use the same administrator account that is used to log in to the product's management console: admin/admin.
Info Make sure that the user ID you are using for JMX monitoring is assigned a role that has the Server Admin permission. See Configuring Roles for further information about configuring roles assigned to users. Any user assigned to the admin role can log in to JMX.
Click Connect to open the Java Monitoring & Management Console. The following tabs will be available:
Localtabgroup Localtab title Overview See the Oracle documentation on using JConsole for more information on these tabs.
Localtab title Memory See the Oracle documentation on using JConsole for more information on these tabs.
Localtab title Threads See the Oracle documentation on using JConsole for more information on these tabs.
Localtab title Classes See the Oracle documentation on using JConsole for more information on these tabs.
Localtab title VM See the Oracle documentation on using JConsole for more information on these tabs.
Localtab title MBeans See the Oracle documentation on using JConsole for more information on these tabs.
Anchor mbeans mbeans
Using the ServerAdmin MBean
...
Jolokia is a JMX-HTTP bridge, which is an alternative to JSR-160 connectors. It is an agent-based approach that supports many platforms. In addition to basic JMX operations, it enhances JMX monitoring with unique features like bulk requests and fine-grained security policies.
Follow the steps below to use Jolokia to monitor a WSO2 product.
- Download Jolokia OSGi Agent. (These instructions are tested with the Jolokia OSGI Agent version 1.3.6 by downloading the
jolokia-osgi-1.3.6.jar
file.) Add it to the
<PRODUCT-HOME>/repository/components/dropins/
directory.Tip In WSO2 EI, add it to the
<EI-HOME>
/dropins/
directory.- Start the WSO2 product server.
Once the server starts, you can read MBeans using Jolokia APIs. Following are a few examples.
- List all available MBeans: http://localhost:9763/jolokia/list (Change the appropriate hostname and port accordingly.)
- WSO2 ESB MBean: http://localhost:9763/jolokia/read/org.apache.synapse:Name=https-sender,Type=PassThroughConnections/ActiveConnections
- Reading Heap Memory: http://localhost:9763/jolokia/read/java.lang:type=Memory/HeapMemoryUsage
For more information on the JMX MBeans that are available in WSO2 products, see Monitoring a WSO2 product with JConsole.