JConsole – Monitor Remote Machine Process (tomcat)

The JConsole graphical user interface is a monitoring tool that complies to the Java Management Extensions (JMX) specification. JConsole uses the extensive instrumentation of the Java Virtual Machine (Java VM) to provide information about the performance and resource consumption of applications running on the Java platform.

Jconsole is very useful in monitoring performance of JVM graphically which helps better when you want to load test your application and figure out different aspects of it. It is convenient to use console on workstation and connecting it to server machine (a different machine). Connecting to Remote JVM process require little configuration at server as well.

You need to set CATALINA_OPTS environment variable which will contain information for connection to it.

For Linux/Unix systems:

# export CATALINA_OPTS=”-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=Port -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.hostname=hostname/IP“

For Windows Systems
Start -> My Computer – > Right click -> Properties – > Advanced -> Environment Variables -> System Variables – > Define CATALINA_OPTS variable with value = ”-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=Port -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.hostname=hostname/IP“

Restart the JVM (tomcat) to see the effect.

jconsole

Now input hostname:port in Remote Process text box and Click on Connect.

More detailed usage documentation can be found here . In above configuration we did not setup any security, details can be found here

Most Commented Posts

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

I found this very useful to remotely monitor MBeans registered with Tomcat through jconsole . However I made the changes to my Catalina.bat in Tomcat installation and not in Environment Variables.
I used the following:
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9875
-Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.hostname=localhost

Leave a comment

(required)

(required)