
How to Enable JMX in WebSphere to Monitor using JConsole?


JAVA Management Extensions (JMX) is a powerful technology to manage and monitor applications or service-driven networks. Using JMX, you can quickly check the WebSphere JVM health.
If you are already using an enterprise monitoring system, then most probably you donโt need this.
However, for learning or interview questions, this will help you to enable JMX & monitor essential metrics of WebSphere JVM.
The good thing about this is you donโt have to install any additional software.
Letโs start with the implementationโฆ
- Login into DMGR Console
- Click on Servers >> Server Types >> WebSphere application servers
- Click on JVM from the list you wish to monitor using JMX
- Expand Java and Process Management under โServer Infrastructureโ and click on Process definition
ย
- Click on Java Virtual Machine under โAdditional Propertiesโ
- Enter following in โGeneric JVM argumentsโ box
-Djavax.management.builder.initial= -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=9000
In the above example, I have entered 9000. You must enter a unique port number to avoid conflicts.
- Click on Review and Synchronize changes with nodes
It would be best if you restarted the JVM to get the port number active. To verify the port, you can use the netstat command.
[[email protected] server1]# netstat -anlp|grep 9000 tcp6ย ย ย ย ย ย 0ย ย ย ย 0 :::9000ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย :::*ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย LISTENย ย ย ย 4575/javaย ย ย ย ย ย ย ย ย ย [[email protected] server1]#
So now, I know JMX port for JVM is listening and ready to be connected from Jconsole.
Jconsole is within the JDK package, so if you have this installed, you should see them under the java/bin folder. Alternatively, you can use find command.
find / -name jconsole
Execute jconsole, and it will prompt you to enter the remote process details. Here you have to give server hostname and JVM port number.
Ex: localhost:9000
It will take a few seconds and connect to WebSphere JVM using JMX port.
On the overview tab, you can see heap memory usage, threads, classes, and CPU usage details.
You can play around with other tabs to see what metrics you need. If you notice under the Memory tab, you will see an option to โPerform GCโ. So you see itโs helpful in many ways.
So go ahead and try out in your testing environment to get familiar.
Next, learn about thread dumps.
More great readings on WebSphere
-
What is Thread Dump and How to Analyze them?Asad Ali on June 29, 2020
-
IBM WebSphere Application Server Beginner’s GuideChandan Kumar on June 9, 2022
-
How to Monitor IBM WebSphere using Application Manager?Chandan Kumar on June 9, 2022
-
How to Use Nginx with WebSphere Application Server?Chandan Kumar on June 9, 2022
-
How to Create Cluster in IBM WebSphere ND?Chandan Kumar on June 9, 2022
-
Whatโs New in WebSphere MQ 9 ย & Installation GuideChandan Kumar on June 10, 2022
Join Geekflare Newsletter
Every week we shareย trending articlesย andย toolsย in our newsletter. More than 10,000 people enjoy reading, and you will love it too.