Chapter 16: Monitoring and Managing Tomcat with JMX Using jconsole GUI to Monitor Tomcat Most administrators create their own script files to perform routine tasks, and the HTML-based access of the Manager application JMX Proxy, as well as the supported Ant tasks, lend themselves well to scripting. For those who would like to monitor and see JMX exposed values in real time, you can use the jconsole utility that is distributed with the JDK since Java 5. The version of jconsole covered in this section is the one distributed with Java SE 6. You must enable the JMX support inside the Tomcat server. To enable this, in the /bin directory, add a file called setenv.bat(or setenv.shin Linux) containing the following line: set CATALINA_OPTS=-Dcom.sun.management.jmxremote You ll need to change the syntax of the environment variable assignment if you are using a Linux shell. If you don t specify the preceding system property, a Java SE 5 jconsole will not be able to connect to Tomcat at all. In Tomcat 6, jconsole can connect to the JVM but does not see any of the Tomcat-exposed MBeans if the preceding system property is not set. Connecting to the Local Running Tomcat Instance With Tomcat 6 running, when you start the jconsole command, you will be prompted to select the JVM to monitor. Look for the local process name of org.apache.catalina.startup.Bootstrap.start. The startup screen for jconsole is shown in Figure 16-13 . Figure 16-13: Attaching to the Tomcat 6 JVM via jconsole
For reliable and cheap web hosting services please check cheap web hosting website.
This entry was posted
on Wednesday, October 28th, 2009 at 7:25 pm and is filed under tomcat.
You can follow any responses to this entry through the RSS 2.0 feed.
Responses are currently closed, but you can trackback from your own site.