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 enterprise monitoring system then most probably you don’t need this.

However, for learning or interview question, 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

 server-infrastructure

  • Click on Java Virtual Machine under “Additional Properties”

java-virtual-machine

  • 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 above example, I have entered 9000. You must enter a unique port number to avoid conflicts.

jvm-arguments-jmx-port

  • Click on Review and Synchronize changes with nodes

You must restart the JVM to get the port number effective. 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 JDK package, so if you have this installed, you should see them under java/bin folder. Alternatively, you can use find command.

find / -name jconsole

Execute jconsole, and it will prompt to enter the remote process details. Here you have to give server hostname and JVM port number.

Ex: localhost:9000

jconsole-connection

It will take few seconds and connect to WebSphere JVM using JMX port.

On overview tab, you can see heap memory usage, threads, classes and CPU usage details.

jconsole-overview

You can play around with other tabs to see what metrics you need. If you notice under Memory tab, you will see an option to “Perform GC”. So you see it’s helpful in many ways.

jconsole-memory

So go ahead and try out in your lab environment and get familiar.

Upgrade your skills by learning cloud computing.