References > Component Monitor Types > Tomcat Server Monitor

Tomcat Server monitor

This component monitor collects server resource information from Apache Tomcat servers by retrieving status information from http://{$IP}:{$PORT}/manager/status/?XML=true.

This component monitor internally issues HTTP requests to the monitored Tombat server. It expects a response in the form of XML, used to parse data and metrics.

Prerequisites for Orion Agent for Linux

If using the Orion Agent for Linux to monitor your Tomcat server, you need to complete installation and configuration of Tomcat to properly work with the component monitors working with the Tomcat Server template.

The following information walks through installing and configuring Tomcat servers to work with SAM component monitors. If you have Tomcat installed, you can skip to step 4 to create an account used for polling.

  1. Determine the version of Tomcat you want to install. You may have multiple versions available to install. To locate all versions, use this command:
    yum search tomcat
  2. After determining the version, you can install the tomcat package and the admin webapps package. Locate the versions to install from the search results. For example:
    tomcat5.i386 : Apache Servlet/JSP Engine, RI for Servlet 2.4/JSP 2.0 API
    tomcat5-admin-webapps.i386 : The administrative web applications for Jakarta Tomcat
  3. Install the versions using the located versions. To install the example above:
    yum install tomcat5 tomcat5-admin-webapps
  4. Next, you need to modify the tomcat-users.xml file to create and provide a user account to access the web manager ('manager','manager-gui'). To locate, use this command:
    find /etc -iname tomcat-users.xml
  5. Edit the file and locate the <tomcat-users> section. If commented out, uncomment the configuration. Edit to add a user of tomcat with the password of tomcat. The template uses this account to access data.
    <tomcat-users>
    <user name="tomcat" password="tomcat" roles="tomcat,manager,manager-gui" />
    <user name="role1"  password="tomcat" roles="role1"  />
    <user name="both"   password="tomcat" roles="tomcat,role1" />
    </tomcat-users>
  6. Restart the service. The command depends on the version you installed. For example, this command restarts the installed service above:
    service tomcat5 restart

Statistic

One of the following Tomcat variables as specified in the Tomcat Variables Name field.

Free Memory

Amount of heap space currently available to the Java Virtual Machine.

Total Memory

Total memory currently allocated to the Java Virtual Machine heap space.

Max Memory

Maximum size of the heap space not including the permanent generation area.

Total Processing Time

Total processing time in milliseconds since server start.

Total Request Count

Total requests from server since server start.

Total Bytes Sent

Total bytes sent from server since server start.

Total Bytes Received

Total bytes sent to server since server start.

Total Error Count

Total error count from all request processors.

Field Descriptions

Description

This field provides a default description of the monitor. You have the ability to override the default description by adding to or replacing the text, which will then be automatically saved. The variable to access this field is ${UserDescription}.

Enable Component

Determines whether the component is enabled. Disabling the component leaves it in the application in a deactivated state not influencing either SolarWinds SAM application availability or status.

Credential for Monitoring

Select a credential that can access the password-protected portion of the web site. If the credential you need is not already present in the credentials list, use the Quick Credentials section to add a new credential.

Port Number

This field allows you to specify the port number used by the web site. The default value for this field is 8080.

Url

Allows you to specify the URL you want to monitor. The SolarWinds SAM variables ${IP} and ${PORT} contained in the default value for this field attempts to monitor a web site at the IP address of the assigned node.

Tomcat Variables Name

Specifies the Tomcat server variable to monitor.

Convert Value

Checking the Convert Value check box opens the Formula box. From here, you have the ability to manipulate the returned value with a variety of mathematical possibilities. You can choose common functions from the drop down lists to manipulate the returned value, or you can select the Custom Conversion option. See setting Conversion value for more information.

Response Time Threshold

This field allows you to set the warning and critical threshold conditions based on the response time. The response time is the time in milliseconds it takes SolarWinds SAM to determine that a component is not Down and to retrieve any statistical data. See setting Application Monitor Thresholds for more information.

Statistic Threshold

This field allows you to specify when a threshold that indicates a warning or critical level has been breached. Logical operators are in the drop down followed by a blank field for you to enter the value of this threshold. For example: Less than 15 for warning, Less than 5 for critical. See setting Application Monitor Thresholds for more information.

User Notes

This field allows you to add notes for easy reference. You can access this field by using the variable, ${UserNotes}.

Install and configure Tomcat

The following information walks through installing and configuring Tomcat servers to work with SAM component monitors. If you have Tomcat installed, you can skip to step 4 to create an account used for polling.

  1. Determine the version of Tomcat you want to install. You may have multiple versions available to install. To locate all versions, use this command:
    yum search tomcat
  2. After determining the version, you can install the tomcat package and the admin webapps package. Locate the versions to install from the search results. For example:
    tomcat5.i386 : Apache Servlet/JSP Engine, RI for Servlet 2.4/JSP 2.0 API
    tomcat5-admin-webapps.i386 : The administrative web applications for Jakarta Tomcat
  3. Install the versions using the located versions. To install the example above:
    yum install tomcat5 tomcat5-admin-webapps
  4. Next, you need to modify the tomcat-users.xml file to create and provide a user account to access the web manager ('manager','manager-gui'). To locate, use this command:
    find /etc -iname tomcat-users.xml
  5. Edit the file and locate the <tomcat-users> section. If commented out, uncomment the configuration. Edit to add a user of tomcat with the password of tomcat. The template uses this account to access data.
    <tomcat-users>
    <user name="tomcat" password="tomcat" roles="tomcat,manager,manager-gui" />
    <user name="role1"  password="tomcat" roles="role1"  />
    <user name="both"   password="tomcat" roles="tomcat,role1" />
    </tomcat-users>
  6. Restart the service. The command depends on the version you installed. For example, this command restarts the installed service above:
    service tomcat5 restart

Troubleshoot Tomcat

To check the XML responses from the a Tomcat server, you can send a simple HTTP request through any web browser to check for raw XML content. The URL should be in the following format: http://host:port/manager/status/?XML=true

You can also query your Tomcat server through CLI using wget.