Come join our live training webinar every other Wednesday at 11am PST and hear LogicMonitor experts explain best practices and answer common questions. We understand these are uncertain times, and we are here to help!
LogicMonitor monitors Tomcat with two approaches:
The datasource HTTP- and HTTPS- check the server availability and responsiveness by sending requests to ports 80 and 443.
If your Tomcat doesn’t listen on the standard port, or you have multiple Tomcat instances running on the same box, you can update the port list in the Active Discovery section of the datasources to add additional ports.
LogicMonitor collects Tomcat internal statistics via JMX. To enable Tomcat JMX monitoring, please follow the steps below:
To enable JMX monitoring without requiring a password, add the following parameters into the CATALINA_OPTS environment variable.
CATALINA_OPTS
-Dcom.sun.management.jmxremote \ -Dcom.sun.management.jmxremote.port=%my.jmx.port% \ -Dcom.sun.management.jmxremote.ssl=false \ -Dcom.sun.management.jmxremote.authenticate=false \ -Djava.rmi.server.hostname=(The IP/DNS name of the server, as added to LogicMonitor)
To enable JMX with password authentication, add the following properties:
-Dcom.sun.management.jmxremote \ -Dcom.sun.management.jmxremote.port=%my.jmx.port% \ -Dcom.sun.management.jmxremote.ssl=false \ -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=%my.conf.folder%/jmxremote.password \ -Dcom.sun.management.jmxremote.access.file=%my.conf.folder%/jmxremote.access \ -Djava.rmi.server.hostname=(The IP/DNS name of the server, as added to LogicMonitor)
Then edit the %my.conf.folder%/jmxremote.access file to include:
%my.conf.folder%/jmxremote.access
monitorRole readonly
Then edit the %my.conf.folder%/jmxremote.password file to include:
%my.conf.folder%/jmxremote.password
monitorRole mypassword
This creates a readonly user monitorRole with the password ‘mypassword‘. For more information on configuring JMX for Tomcat, refer to Tomcat’s Documentation here.
monitorRole
mypassword
Add the following three device properties to reflect what you have configured Tomcat JMX from Step 1:
tomcat.jmxports = <jmx_port>
jmx.user = <jmx_user>
jmx.pass = <jmx_pass>
Note: If you run multiple tomcat instances on your servers, or use different ports on different servers, you can specify a comma separated list of ports to query for JMX information in the tomcat.jmxports variable.
tomcat.jmxports
After several minutes, the LogicMonitor will update its database and start collecting Tomcat internal stats via JMX.
If you finish the steps above, and find LogicMonitor still can’t collect Tomcat internal stats, the failure is usually caused by network issue (e.g. firewall), Tomcat configuration, or incorrect username/password. You can use jconsole (part of the SUN JDK) to check the real reason.
In This Article