You are here

JConsole

JConsole

JConsole is a tool that comes with the standard Oracle/Sun version of the Java JDK. It's helpful in watching the overall behavior of a Java Virtual Machine.

If you want to set this up to monitor a Tomcat instance, you must add a few JVM parameters in catalina.sh:

-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.password.file=/home/scott/apache-tomcat/conf/jmxremote.password
-Dcom.sun.management.jmxremote.access.file=/home/scott/apache-tomcat/conf/jmxremote.access

Also you must create 2 files:
jmxremote.access

tomcat readonly
admin readwrite

jmxremote.password

tomcat <password>
admin <password>

Add an entry in your server.xml under <Server port="8005" shutdown="SHUTDOWN">

<Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener"
          rmiRegistryPortPlatform="10001" rmiServerPortPlatform="10002" />

Make sure $CATALINA_HOME/lib has the catalina-jmx-remote.jar file available.

Connect to it using JConsole with a connection string like this:

service:jmx:rmi://<hostname/IP address>:10002/jndi/rmi://<hostname/IP address>:10001/jmxrmi

References:
http://www.techiegyan.com/2009/08/13/jconsole-monitor-remote-machine-pro...

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.