Apache Tomcat — Prerequisites
Prerequisites for monitoring Apache Tomcat with HEAL.
Prerequisites to complete before adding this component in the HEAL Control Center.
Java Options in the startup file must be modified to enable JMX port. To do so, follow these steps:
-
Open the
<tomcat_home>/bin/setenv.shon Linux orsetenv.cmdin case of Windows systems and add the following directive.NOTE: If thesetenv.*file is not available in the Tomcat’s bin folder, you may create it and then add the following lines.Linux/Unix:export CATALINA_OPTS=$CATALINA_OPTS "-Djava.rmi.server.hostname=<IP address of Tomcat Computer> -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=<JMX port number> -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=<path-to-password-file> -Dcom.sun.management.jmxremote.access.file=<path-to-access-file>"Windows:
set CATALINA_OPTS=%CATALINA_OPTS% "-Djava.rmi.server.hostname=<IP address of Tomcat Computer> -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=<JMX port number> -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=<path-to-password-file> -Dcom.sun.management.jmxremote.access.file=<path-to-access-file>"Note: We are using CATALINA_OPTS instead of JAVA_OPTS to set Tomcat-specific options.w
Note: When the Tomcat application server is installed as a Service, follow these steps to enable the JMX port:
- Log on to the Windows Server on which the Tomcat is installed as Service.
- Navigate to Start → Program Menu → Apache Tomcat folder and click Configure Tomcat. The Apache Tomcat <Version> <Service Name> Properties screen is displayed.
-
Select the Java tab and enter the details in the Java Options section:
-Djava.rmi.server.hostname=<IP address of Tomcat Computer> -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=<JMX port number> -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=<path-to-password-file> -Dcom.sun.management.jmxremote.access.file=<path-to-access-file> -
Click Ok.
- Restart the Tomcat Service.
You should now see the configured port listening for JMX connections.
-
Restart the Tomcat normally. You should now see the configured port listening for JMX connections.
To determine the Tomcat server’s port number (monitor port):
- Open the
server.xmlfile located at<tomcat_home>/bin/confdirectory. - Search for the word HTTP Connector Port in the Tomcat’s
server.xmlfile. Tomcat’s default HTTP port is8080.
Ensure that Tomcat server’s monitor port (default 8080) and JMX port are opened for data collection to collect Tomcat and JVM KPIs.
See also: Apache Tomcat (what HEAL monitors)