Before running the Tomcat bin/start.sh
script, run the following to allow unsecured queries against the Tomcat server:
JAVA_OPTS="-Dcom.sun.management.jmxremote.port=12346" JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.authenticate=false" JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=false" export JAVA_OPTS
The same JAVA_OPTS
approach can be used to enable remote access to Tomcat MBeans. Set the JAVA_OPTS
variable as illustrated above and then execute the ./catalina.sh start command in the ${TOMCAT_HOME}/bin
directory.
Tomcat 6.0.14's catalina.sh does not process the stop command properly when the JAVA_OPTS
variable is set. We recommend using two separate shell scripts when troubleshooting JMX problems in Tomcat: one for starting Tomcat (with the JAVA_OPTS
variable set) and a different one for stopping Tomcat (where the JAVA_OPTS
variable is not set).
If you add the above lines to the to bin/setenv.sh
(as seems to be the logical thing to do in catalina.sh
to get the environment variables set up), the bin/shutdown.sh
script will get those same environment variables. This will cause the shutdown.sh
script to attempt to bind to the ports, fail, and then not stop Apache Tomcat.
All Apache Tomcat services must have a device entry under the /Devices/Server/Tomcat
device class.
The zenjmx daemon must be configured and running. See Section 2.1, “Sun Java Runtime Environment (JRE)” for more information about configuring the zenjmx daemon with the Sun JRE tools.
Navigate to the device or device class under the /Devices/Server/Tomcat
device class in the Zenoss web interface.
If applying changes to a device, click the page menu, then select
→ .If applying changes to a device class, click the zProperties tab.
Edit the appropriate zProperties for the device or devices.
Table 18.2. Tomcat zProperties
Name | Description |
---|---|
| Used to construct MBean names for a specific application deployed on Tomcat, typically used for JSP and Servlet statistics. |
| Used to construct MBean names for a specific application deployed on Tomcat, typically used for JSP and Servlet statistics. |
| This zProperty is deprecated. |
| JMX password. |
| The port number used to gather JMX information. |
| JMX username for authentication. |
| The hostname on which Tomcat is listening for web requests. This is used to construct MBean names. |
| The Tomcat connector, which is a port and protocol (http, jk...) that Tomcat is listening on. This is used to construct MBean names that monitor bytes, error and requests on that connector. |
| Specific Servlet name to monitor. |
| URI of Servlet to monitor. |
| URI path for a Tomcat web application. Used to construct MBean names. |
Click
to save your changes.You will now be able to start collecting the Tomcat server metrics from this device.
Navigate to the Perf tab and you should see some placeholders for graphs. After approximately 15 minutes you should see the graphs start to become populated with information.
The out-of-the-box TomcatMonitor data source configuration has been defined at the macro level, but can be configured to operate on a more granular basis. For example, the Servlet Reload Count applies to all servlets in all web applications but it could be narrowed to be Servlet /submitOrder in web application "production server".