This template collects server resource information from an Apache Tomcat server by retrieving status information from the Tomcat status page. You can use the Orion agent for Linux or SNMP agentless to monitor.
User with manager role. Tomcat users and roles can be configured in tomcat-users.xml file.
<role rolename="manager"/> <user username="user" password="pass" roles="manager"/>
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.
Follow these steps to install and configure Tomcat servers to work with SAM component monitors. If Apache Tomcat is already installed, you can skip to step 4 to create an account used for polling.
- 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
- 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
- Install the versions using the located versions. To install the example above:yum install tomcat5 tomcat5-admin-webapps
- Next, you need to modify the tomcat-users.xml file to create a user account to access the web manager ('manager','manager-gui'). To locate, use this command:find /etc -iname tomcat-users.xml
- Edit the file and locate the <tomcat-users> section. If commented out, uncomment the configuration. Edit to add a user of
tomcatwith 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>
- Restart the service. The command depends on the version you installed. For example, this command restarts the installed service above:service tomcat5 restart
For details on monitors, see SAM component monitors.
Set thresholds for counters according to your environment. It is recommended to monitor counters for some length of time to understand potential value ranges and then set the thresholds accordingly. To learn more, see Understand application monitor thresholds.
The component monitor can also test the security certificate. You can configure how certificate errors are handled by setting the Ignore CA Errors and Ignore CN Errors options. See Tomcat Server monitors for details.
By default all components use port 8080. If your Tomcat server uses another port, you should manually change the Port Number field in all components.
Tomcat Free Memory
This monitor returns the amount of heap space currently available to the Java Virtual Machine. This value should be as high as possible. The heap space may be of a fixed size or may be expanded and shrunk, depending on the garbage collector's strategy. More information can be found here: .
Tomcat Total Memory
This monitor returns the total amount of memory currently allocated to the Java Virtual Machine heap space. This value should be as low as possible. You should set thresholds according to your Tomcat Max Memory value. If the returned value is near the Tomcat Max Memory value or you received OutOfMemoryError errors, you may need to increase the heap size. More information can be found here: .
Tomcat Max Memory
This monitor returns the maximum size of the heap space, not including the permanent generation area.
Tomcat Total Processing Time
This monitor returns the total processing time, in milliseconds, since the server started.
Tomcat Total Request Count
This monitor returns the total number of requests from the server since the server started.
Tomcat Total Bytes Sent
This monitor returns the total number of bytes sent from the server since the server started.
Tomcat Total Bytes Received
This monitor returns the total number of bytes sent to the server since the server started.
Tomcat Total Errors Count
This monitor returns the total number of errors from all request processors.