Tomcat Servers


Supported Versions

The supported versions of Tomcat Servers are 3.x, 4.x, 5.x, 6.x, 7.x and above. For Tomcat Server 3.x and 4.x, agent has to be deployed for monitoring.

Note: You can check whether the Agent is deployed, by connecting to the following URL in Tomcat Server.
http://<Tomcat-Host>:<Tomcat-Port>/adventnet/DataServlet

To deploy the agent for Tomcat Server 3.x

  1. Download the Tomcat3Agent.Zip from <Applications Manager Home>/working/classes directory.
  2. Unzip it in the <Tomcat Home> directory of the host in which the Tomcat server is running.
  3. Restart the Tomcat Server.

To deploy the agent for Tomcat Server 4.x 

  1. Download the Tomcat4Agent.Zip from the <Applications Manager Home>/working/classes directory
  2. Unzip it in the <Tomcat Home> directory of the host in which the Tomcat server is running.
  3. Add the following tag in server.xml file located in the <Tomcat Home>/conf directory (below the Engine tag).
    <Valve className="com.adventnet.appmanager.tomcatagent.ver4.valve.AdventNetHostValve"/>
    [Click the link to view an example server.xml]
  4. Restart the Tomcat Server.

To deploy the agent for Tomcat Server 4.x and Apache server combined

  1. Download the Tomcat4Agent.Zip from the <Applications Manager Home>/working/classes directory
  2. Unzip it in the <Tomcat Home> directory of the host in which the Tomcat server is running.
  3. Add the following tag in server.xml file located in the <Tomcat Home>/conf directory (below the Engine tag).

    <Valve className="com.adventnet.appmanager.tomcatagent.ver4.valve.AdventNetHostValve"/>

    [Click the link to view an example server.xml]
  4. Restart the Tomcat Server.
  5. Apache:In Apache mod_jk.conf file of Apache Server , add the following entry 
    • JkMount /adventnet/* ajp13, Where ajp13 is the worker name .It has be the name given in worker.properties file.
  6. Restart Apache server

To create a Tomcat Server Monitor

  1. Click on New Monitor link.
  2. Select Tomcat Server.
  3. Enter the IP Address or hostname of the host. [Note: Also refer to Configurations based on Tomcat Deployments section]
  4. Enter the SubNetMask of the network.
  5. Enter the port number in which the monitor is running. [Default port number is 8080]
  6. Choose SSL option , if SSL is enabled in Tomcat server.
  7. Enter the polling interval time in minutes.
  8. If you are adding a new monitor from an Admin Server, select a Managed Server.
  9. Provide the monitor-specific authentication information, such as user name and password.

Note:

Applications Manager agent has to be deployed in Tomcat Servers 3.x and 4.x.

Tomcat 3.x and 4.x needs no user name and password. In case of Tomcat 5.x and above, an application named Manager must be running in it for Applications Manager to monitor the Tomcat server. By default, this application will be running in the server.If you have customized the manager application (Eg., \qamanager), then you can use the option "Tomcat Manager Application URI" in the client, for Applications Manager to monitor the Tomcat server.

For Tomcat Versions 5.x & 6.x and 7.x:

  • The user role to access the server must be manager (versions 5.x & 6.x) / manager-jmx (version 7.x).
  • To add a role as "manager" (versions 5.x & 6.x) / "manager-jmx" (version 7.x) for any of the users such as tomcat, role1, or both, you need make changes in tomcat-users.xml file located in the <TOMCAT-HOME>/conf directory.

For Tomcat 8:

Remote access to Application Manager is restricted, by default.

Add the IP address of APM in CATALINA_HOME/webapps/manager/META-INF/context.xml (under 'allow =' )

<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />


Example:

Default configurations in tomcat-users.xml in Tomcat Server.

<tomcat-users>
<role rolename="tomcat" />
<role rolename="role1" />
<user username="tomcat" password="tomcat" roles="tomcat" />
<user username="role1" password="tomcat" roles="role1" />
<user username="both" password="tomcat" roles="tomcat,role1" />
</tomcat-users>
 

After adding the roles for the "tomcat" user, the modified entries will be as follows:

<tomcat-users> 
<role rolename="tomcat" />
<role rolename="role1" />
<role rolename="manager" />
<user username="tomcat" password="tomcat" roles="tomcat,manager" /> 
<user username="role1" password="tomcat" roles="role1" /> 
<user username="both" password="tomcat" roles="tomcat,role1" /> 
</tomcat-users>
 

On making the configuration, restart the Tomcat Server.
Now, when adding a new Tomcat (5.x and above) monitor, specify the username/password as tomcat/tomcat when discovering the Tomcat Server.

[Click the link to view an example tomcat-users.xml for versions 5.x / 6.x and tomcat-users.xml for versions 7.x]

Note:

After adding the Manager role in tomcat-users.xml, you should be able to access the manager application - <Host>:<PORT>/manager/status (Provide manager user credentials).

If the application is not accessible, add the following entry in server.xml, under 'Engine' context:
<Realm className="org.apache.catalina.realm.MemoryRealm" />

Restart the server and try to access manager application.

  1. Choose the Monitor Group from the combo box with which you want to associate Tomcat Server Monitor (optional). You can choose multiple groups to associate your monitor.

  2. Click Add Monitor(s). This discovers Tomcat server from the network and starts monitoring them.

 

Troubleshoot: Having trouble in monitoring Tomcat server? Refer to the online Troubleshooting section.

Note : Steps to configure Tomcat Monitor for JBoss 3.2.5

  1. Append the following in the web.xml present in <JBOSS_SERVER_HOME>\deploy\jbossweb-tomcat50.sar\ROOT.war\WEB-INF folder

    " <servlet-mapping>
    <servlet-name>Status Servlet</servlet-name>
    <url-pattern>/manager/status</url-pattern>
    </servlet-mapping> 

    <servlet-mapping>
    <servlet-name>Status Servlet</servlet-name>
    <url-pattern>/manager/</url-pattern>
    </servlet-mapping> 

    <servlet-mapping> 
    <servlet-name>Status Servlet</servlet-name>
    <url-pattern>/manager/status/</url-pattern> 
    </servlet-mapping> "
  2. Restart the JBoss server.

  3. Configure a tomcat monitor by clicking New Monitor --> Select Tomcat Server in the combo box.

  4. Select the version as 5.x and create the monitor. This will create a monitor for the Tomcat webserver running in JBoss3.2.5.

Configurations based on Tomcat Server Deployment

Monitoring of Tomcat Server depends on its deployment. This section explains the possible deployment scenarios of Tomcat. Your configuration of host name and the port depends on these scenarios.

 

1. Standalone Tomcat Server

This is a general scenario wherein you have a Tomcat server which has the HTTP (apache) within its deployment. In this case, when configuring a tomcat monitor, specify the host name of the Tomcat server and the port of the HTTP.

2. One Tomcat Server (with HTTP) and one external instance of Apache

There is one Tomcat server with HTTP (apache) instance running in it and another external Apache running outside.

Example: Tomcat server name: Tomcat A; HTTP (in Tomcat server) port: 8080; External Apache server port: 80

In this case, while configuring for a Tomcat monitor, specify the host name as 'Tomcat A' and specify the port of the HTTP that runs with the Tomcat and not the external Apache, i.e., specify the port as 8080 and not 80.

3. One Tomcat Server (without HTTP) and one external instance of Apache

There is one Tomcat server without HTTP in it and another external Apache running.

Example: Tomcat server name: Tomcat A; HTTP (in Tomcat server) port: Not available; External Apache server port: 80

In this case, while configuring for a Tomcat monitor, specify the host name as 'Tomcat A' and specify the port of the external Apache, i.e., 80.

4. Multiple Tomcat Server (with HTTP instances in each of these servers) and one external instance of Apache

There are multiple Tomcat servers, say 3, with HTTP instances in each of them and another external Apache running.

Example: Tomcat Server names: Tomcat ATomcat BTomcat C; HTTP (in Tomcat servers) port: 807080808090 respectively; External Apache server port: 80

In this case, you need to create tomcat server monitor individually for Tomcat A, Tomcat B, and Tomcat C and specify their ports as 8070, 8080, and 8090 respectively.

5. Multiple Tomcat Server (without HTTP instances in these servers) and one external instance of Apache

There are multiple Tomcat servers, say 3, without HTTP instances in them and another external Apache running.

Example: Tomcat Server names: Tomcat ATomcat BTomcat C; HTTP (in Tomcat servers) port: Not available; External Apache server port: 80

You can monitor only one of the instances in this case. Please contact appmanager-support@manageengine.com if you would like to have it added.

Monitored Parameters

Tomcat Servers are monitored based on the parameters or the attributes listed below. These attributes provide information about the functioning of the Monitors of Tomcat server. You can also configure thresholds to the numerical attributes monitored by the server based on these details.

Availability tab, gives the Availability history for the past 24 hours or 30 days. Performance tab gives the Health Status and events for the past 24 hours or 30 days. List view enables you to perform bulk admin configurations. Click on the individual monitors listed, to view the following information.

Overview

ParametersDescription

Availability

Shows the current status of the server - available or not available.

Response Time The time taken for the tomcat server to respond while monitoring in milliseconds
Average Processing Time The average processing time taken to process a request in milliseconds
Requests Per Minute The average number of requests received by the server in one minute
Average Bytes Per Minute The average bytes send per minute
Successful Requests The number of requests served successfully
Errors The number of error request received
Requests Failed percentage Percentage of requests failed.
Class Loaded The number of classes currently loaded in the java virtual machine.
Class Unloaded The number of classes unloaded since the java virtual machine has started
Total Class Loaded The total number of classes loaded since the java virtual machine has started execution.
Daemon Threads The number of live daemon threads
Live Threads Current number of live threads 
Total Threads Started The total number of threads started since the java virtual machine started.

Memory

ParametersDescription
Name The memory pool name
Type Memory pool type. i.e, (Heap memory , Non-Heap Memory)
Used Memory in MB Used memory in MB
Free Memory in MB Free memory in MB
Committed Memory in MB Committed memory in MB
Maximum Memory in MB Maximum memory allocated in MB
Used memory in % Percentage of memory used
Free memory in % Percentage of memory free
Name Garbage collector name
Number of collections per Minute Number of garbage collections occurred per minute
Collection Time per Minute Collection time in milliseconds.

Thread

ParametersDescription
Connector Name The thread pool connector name
Busy Threads Number of threads currently busy
Current Threads Number of threads currently created
Maximum Threads The maximum number of active threads can present in this pool
Percentage Used Percentage of threads used 
Percentage Free Percentage of threads free 

JDBC

ParametersDescription
JNDI Name The JNDI name of the datasource
Context The web application context name
Active Connections Number of active connections to the data source
Idle Connections Number of idle connections to the data source
Active Connections in % Percentage of active connections (not applicable if maximum active connection is unlimited i.e. configured as -1)
Idle Connections in % Percentage of idle connections  (not applicable if maximum idle connection is unlimited i.e. configured as -1)

Web

ParametersDescription
Connector Name Connector name of the global request processor
Request Count Number of requests served by this global request processor
Error Count Number of error request received
Processing Time Time taken by this global request processor to process the requests in milliseconds
Bytes Send Per Second Average bytes send per second
Bytes Received Per Second Average bytes received per second
Successful Request (%) Percentage of successful requests
Failed Request (%) Percentage of failed requests

Web Applications

ParametersDescription
Context Web application's context name
Status Status of the web application such as STARTED, STOPPED
Processing Time (ms) The processing time taken to process the requests in milliseconds
Successful Requests Number of successful request served for this web application
Failed Requests Number of error request for this web application
Average Response Time (ms) Average response of this web application in milliseconds
Average Request Per Minute Average requests for this web application per minute
Average Bytes Per Second Average bytes send per second
No.of Open Sessions Number of sessions currently open / active
No.of Expired Sessions Number of sessions expired
No.of Rejected Sessions Number of sessions rejected

Servlets

ParametersDescription
URL The name of the servlet
Context Web application's context name
Processing Time (ms) The processing time in milliseconds
Successful Requests Number of successful request
Failed Requests Number of error request
Average Response Time (ms) Average response time in milliseconds
Average Requests Per Minute Average requests served per minute