Apache Tomcat

For general options, see Set up Agents.

If you run Tomcat as a Windows service, see further below.

If launched from a batch file or shell script:

Tomcat 7.x or later

For Tomcat 7.x or later, it is recommend to configure environment variables in the setenv.bat or setenv.sh script located in CATALINA_BASE/bin or CATALINA_HOME/bin.
This file is not typically found in a default Tomcat-only installation and must be created manually, co-located with startup, (in bin). Be sure to place it in the right directory matching your installation type and OS.

Add the following command to setenv.bat:

SET CATALINA_OPTS=-agentpath:<DT_HOME>\agent\lib\dtagent.dll=name=<AgentName>,server=<CollectorName>

Tomcat 6.x

  1. Open the catalina.bat script in your Tomcat installation. By default, this file should be located in the <TOMCAT_HOME>\bin folder.

  2. Set the CATALINA_OPTS variable to: -agentpath:<DT_HOME>\agent\lib\\dtagent.dll=name=<AgentName>,server=<CollectorName> as shown below.

    ...
    rem $Id: catalina.bat 609438 2008-01-06 22:14:28Z markt $
    rem ---------------------------------------------------------------------------
    set CATALINA_OPTS={dtagentstring_win}
    rem Guess CATALINA_HOME if not defined
    

Tomcat 5.5.x

For running Tomcat 5.5.x with Java 1.6 or higher, see the Tomcat 6.x configuration steps.

Tomcat as a Windows service

  1. If available, access the Tomcat Service Manager by choosing Start menu > All Programs > Tomcat > Monitor Tomcat.
    Otherwise, <TOMCAT_HOME>/bin /tomcatw<version>.exe //ES//<serviceName> displays the Apache Tomcat Properties dialog box.
    For example, to instrument Atlassian Confluence, get the Confluence service name from Properties in the Services Control Panel and
    <ConfluenceProgramDirectory>/bin /tomcatw<version>.exe //ES//Confluence<serviceNumber>. Note that <ConfluenceHome> is not the program directory, but the data directory.

  2. Select the Java tab and add the following line at the bottom of the Java Options:
    -agentpath:<DT_HOME>\agent\lib\\dtagent.dll=name=<AgentName>,server=<dynatraceCollectorName> Depending on the version and / or Agent path (with or without spaces), quotes may be needed around the path (as shown in the wizard sample string) or may get in the way.

    If this fails, check for the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\Tomcat<version>\Parameters\Java.