Find Out How

Print Friendly Version

Monitoring Apache Tomcat

Prerequisites

In order to monitor a Tomcat server, the JMX Remote Agent must be enabled. If you are not sure how to enable this, consult the "Monitoring and Management" section of the Tomcat documentation.

In addition, the SOASTA sBox must be able to establish a TCP/IP connection to the JMX Remote Agent port on the server.

If a firewall prevents TCP/IP access, see the topic Monitoring a Server Behind a Firewall.

Supported versions

SOASTA CloudTest can currently monitor Apache Tomcat 5.5 and 6.0.

Steps

  1. In the Central list, select Monitoring Servers Groups.

Central list, Monitoring Server Groups

  1. Click the New Monitoring Server Group icon.
    The Monitoring Server / Monitor wizard appears:

New Monitor Server Group icon

  1. Type a name for the Monitoring Server and optionally provide a description.  Finally type the hostname or IP address of the server into the Host field and click Next.

 

  1. The Resources step is shown. Check "App Servers" and click Next.

 

  1. Select Tomcat, then enter the JMX port number, the user name, and password. The user name and password are not always required. Check with your network administrator. Note that Tomcat does not have a default port. It is chosen when you set up the JMX Remote Agent.
  1. Click the Test Connection button to test the connection. If the connection is successful, you will see a pop-up containing some information about the Tomcat server. If the connection fails, you will see an error message explaining what went wrong.
  1. Click Next.
  1. Review the information to be sure it is correct, then check the "Create a new Monitor for this Monitor Server" box and click Finish.

 

  1. Enter a name for the Monitor and an optional description, then click Next.

 

At this point you can choose which statistics you are interested in. For each statistic, you can choose a "sample rate" which determines how often that statistic will be collected.

  • In addition to the standard statistics that are offered (for example, "JVM Heap Size"), you can track the value of any JMX MBean attribute. For example, to track the current number of sessions in the web application /mywebapp, check the "JMX Attribute" box, and in the "Arguments" column enter:

Catalina:type=Manager,
path=/mywebapp,host=localhost:sessionCounter

You can use the "Add Custom Object" button to add as many JMX MBean attributes as you like. Some more examples:

  • To track the total amount of time spent processing HTTP requests since Tomcat started, in the "Arguments" column enter:

Catalina:type=GlobalRequestProcessor,name=http-8080:processingTime

  • To track the current number of threads in the HTTP thread pool, in the "Arguments" column enter:

Catalina:type=ThreadPool,
name=http-8080:currentThreadCount

When you are finished, click Next.

  1. Review the information to be sure it is correct, then click Finish.

 

Next steps