Monitoring on-premises Tomcat applications
You can configure the Tomcat light weight data collector to monitor the on-premises Tomcat applications running on Docker containers and then send monitoring data to the Unified Agent.
Before you begin
- Ensure that you install the Unified Agent plug-ins for LWDC and OpenTracing. For more information, see Installing and configuring Unified Agent plug-ins.
- Check whether you downloaded the Tomcat light weight data collector package. For more information, see Downloading the Tomcat light weight data collector.
Procedure
-
Create a silent_config_tomcat_dc.txt silent configuration file in the same directory as your Dockerfile. The silent configuration file is available in the installation package. A sample of the silent configuration is as follows:
JAVA_HOME=/usr TT_STATUS=true DD_STATUS=false MT_STATUS=false SERVER_NAME=TestServer SERVER_HOME=/opt/tomcat/apache-tomcat-9.0.5 SERVER_VERSION=8 SERVER_JMX_HOSTNAME=127.0.0.1 SERVER_JMX_PORT_NUMBER=9966 SERVER_JMX_USER_NAME= SERVER_JMX_PASSWORD=
where:
JAVA_HOME
is the Java home that is used by the Tomcat server. The default value is /usr.TT_STATUS
is the flag to enable transaction tracking.DD_STATUS
andMT_STATUS
are currently not used, and can be set to default values.SERVER_NAME
is the name of the Tomcat server that is monitored by the data collector. The default value is 'TestServer'SERVER_HOME
is the Tomcat server home directory, default value is /opt/tomcatSERVER_VERSION
is Tomcat server version, default value is 8. Supported values are 8 and 9.SERVER_JMX_HOSTNAME
is the hostname where JMX for corresponding Tomcat Server will be accessible.SERVER_JMX_PORT_NUMBER
is the port number to be configured for accessing JMX for the containerized Tomcat server.SERVER_JMX_USER_NAME
is the user name for authentication of JMX connection. Default value is blank that indicates 'no authentication'.SERVER_JMX_PASSWORD
is the password of JMX user for authentication of JMX connection. Default value is blank that indicates 'no authentication'
-
Add the following environment variables:
UA_LWDC_LISTENER_URL=http://<ip or host>:<port> UA_JAEGER_ENDPOINT=http://<ip or host>:<port>/api/traces
where:
ip or host
is the ip or host address where you install Unified Agent in on-premises environment.port
is the port that you configure in Installing and configuring Unified Agent plug-ins. By default, it is 8848 for UA_LWDC_LISTENER_URL and 14268 for UA_JAEGER_ENDPOINT.
-
Build the new docker image.
docker build -t <application image name>:<image tag>
- Start your Tomcat application with the new docker image.