Cheap VPS & Xen Server

Residential Proxy Network - Hourly & Monthly Packages

How To Monitor And Manage Apache Tomcat


This guide provides an overview on how to monitor and manage Apache Tomcat application server. The guide is divided into following steps:

  1. Adding Apache Tomcat to the list of monitored applications.
  2. Configuring availability sensors and performance counters for Apache Tomcat.
  3. Tomcat plugin overview.
  4. Setting up alarms and notification policies.

Tools used in this guide:

  • Apache Tomcat: http://tomcat.apache.org/
  • Free monitoring tool (Verax NMS express): http://www.veraxsystems.com/en/products/nms

Adding Apache Tomcat To Device Inventory

In order to include Apache Tomcat to be monitored by Verax NMS, add an application instance to the device actually running this instance.

Note: The system allows for creating multiple instances for applications of the same type on a single device.

In order to add an Apache Tomcat to the device running its instance, perform the following steps:

  1. Log in into the Verax NMS and select Home from the mainmenu.
  2. Select a device running the Apache Tomcat instance from the left-side aspects view.

1

In Summary tab select Manage applications from the actions section.

2

A pop-up dialog is displayed.

3

Select Add application option from the context menu and click Go. A dialog window is displayed.

4

  1. Choose Apache Tomcat from Application types.

Systems will ask to enter the following application-specific parameters:

  • Instance name – You can enter any name describing the monitored application instance.
  • Host – In most cases, the host address is an IP address of the device the application instance is assigned to.
  • Port – Port of application server.
  • User – Username used to connect to Apache Tomcat.
  • Password – Password used to connect to Apache Tomcat.
  • JMX Connection – Set jmx connection url
  • JMX User
  • JMX Password

Note: application-specific parameters depend on the selected application type.

  1. Provide the necessary information and click Save changes.
  2. The system will ask if you want to add a default set of sensors and counters for Apache Tomcat. In this guide sensors and performance will be added manually, so click No.
  3. The newly added Apache Tomcat is now visible in the aspect tree within the host’s node in Managed Applications category.

6

Apache Tomcat instance can be monitored by:

  • Obtaining information and statistics on demand using Show advanced view action available on Summary tab which shows several views with major information about server as well as performance characteristics.
  • Collecting performance data by configuring performance counter using JMX counter or predefined JMX-based counter templates.
  • Checking application or service availability by configuring JMX-based sensor.
  • Checking web application availability and measure user-experience by configuring HTTP sensor.

 

Adding Sensors For Apache Tomcat

Monitoring of Tomcat features in NMS uses the JMX protocol. This protocol should be properly configured on the Tomcat server side. This require the following Java parameters on server startup:

set CATALINA_OPTS=-Dcom.sun.management.jmxremote \

-Dcom.sun.management.jmxremote.port=%my.jmx.port% \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false

See the Tomcat documentation for details: http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html

Sensors are active monitors periodically querying the device services for which they are configured and waiting for their responses. If a query is returned with an expected response, the queried service is considered “available.” If a response is not received (timed out), or if the response is not as expected, the queried service is considered “unavailable”.

The following types of sensors for Apache Tomcat application type are available by default:

  • JMX Operation – Checks if given operation invoked by device JMX service returns a result for given MBean.
  • JMX Attribute – Checks if given attribute get by device JMX service returns a value for given MBean.
  • HTTP – Checks if device HTTP service gives a response defined in parameter “Response code” for given HTTP/HTTPS address and if regular expression is given if response body contains a string matching the expression.

In order to add a sensor, perform the following steps:

  1. Select device from the aspect tree in Home view.
  2. Select Monitors tab and switch to sensor list by clicking Sensor list link in the upper-right corner of the tab field. The sensor list is displayed.

8

  1. Select Add from the global action menu and click Go. The wizard dialog is displayed.

9

Select the sensor you want to add and click Next.

10

A dialog shows up with all sensor parameters to be provided. Specify the sensor parameters and click Finish.

Once the sensors have been added, they are visible on the sensor list (Monitors tab).

Adding Performance Counters For Apache Tomcat

Performance counters measure system activity and performance (metrics). The application retrieves their current values in predefined intervals. The aim of probing and collecting data is to analyze and convert the data into a performance graph/chart. You can define a counter manually or load it from a template. Counter templates provide defined probing parameters for specified devices in order to improve and quicken counter creation.

Each counter template is characterized by the following information:

  • Name and description – unique identifier and optional description,
  • Device type – type of a device,
  • Protocol type – protocol used,
  • Probing interval – pauses between probing.

In order to add Apache Tomcat performance counters, perform the following steps:

  1. Select device from aspect tree in Home view.
  2. Select Monitors tab and switch to the counter list by clicking Counter list link in the upper-right corner of the tab field. A counter list is displayed.
  3. Select Create counter from the global action menu and click Go.

12

Select the counter you want to create and click Next.

Once the data has been loaded, the edit window shows up with all counter attributes to be provided.

13

  1. Specify the rest of counter parameters (alarms, thresholds etc.) and click Finish.
  2. The new counter has been created and is now visible on the counter list.

 

Creating Custom Event Processing Rules For Apache Tomcat

In this tutorial I’ll show how to assign basic event processing rules, such as: alarm generating, event dropping/forwarding and severity assigning.

To assign an event processing rule, perform the following steps:

  1. After selecting the desired host go to Events tab.
  2. Select events, choose Assign processing rules and click Go.
  3. A dialog window is displayed (see figure below).

14

Select rule category and click Add new rule.

The newly created event processing rule is now visible and active (there’s no need to logout).

 

Tomcat Plugin Overview

Tomcat plugin provides four following views:

  • General information view – overall information about Tomcat version, OS Name and version, JVM vendor and version, JVM info,Control port, Average Response Time. It also contains dashboard view with charts for response summary and threads availability).
  • Applications view – information concerning applications status: current sessions, peak sessions as well as servlets and page performance: URL and average response time.)
  • Request processors view – information concerning request processors and global request processor (URI, Worker, request and error counts, sent and received bytes, processing time) and chart for response summary for connector.)
  • Connectors and thread pools view – information concerning connectors parameters (port, protocol, secure, redirect port, max post size), thread pool (name, current threads busy, current threads count, max spare threads) and chart for threads availability.)

15

If you performed all actions described in this guide you are now able to monitor Apache Tomcat application.

 

 

Comments

comments