Apache Tomcat Monitoring

Tomcat server monitoring and performance management made easy with Site24x7 plugins.

Start 30-day free trial Try now, sign up in 30 seconds

Prerequisites

  • Download and install the Site24x7 server monitoring agent (Linux | Windows) in the server where you plan to run the plugin.
  • For Linux servers, follow the steps below:
    • Navigate to the following directory: /opt/tomcat/conf
    • Open the tomcat-users.xml file.
    • Ensure the following roles are added to the user:
      <user username="user" password="user" roles="manager-gui,admin-gui"/>
      <user username="user" password="user" roles="manager-script"/>
    • Restart the Tomcat server.
  • For Windows servers, follow the steps below:
    • Navigate to the following directory: <tomcat_dowloaded_directory>\conf
    • Open the tomcat-users.xml file.
    • Ensure the following roles are added to the user:
      <user username="user" password="user" roles="manager-gui,admin-gui"/>
      <user username="user" password="user" roles="manager-script"/>
    • Restart the Tomcat server.

Plugin Installation

  • Create a folder named tomcat.
  • Download the tomcat.py and the tomcat.cfg files from our GitHub repository and the place them in the tomcat folder.
    wget https://raw.githubusercontent.com/site24x7/plugins/master/tomcat/tomcat.py && sed -i "1s|^.*|#! $(which python3)|" tomcat.py
    wget https://raw.githubusercontent.com/site24x7/plugins/master/tomcat/tomcat.cfg
  • To check if the plugin is working, execute the command below and check for a valid JSON output with applicable metrics and their corresponding values.
    python tomcat.py --host "hostname" --port "port" --username "username" --password "password"
  • Add the applicable configurations in the tomcat_connector.cfg file:
    [tomcat]
    host = "localhost"
    port = "8080"
    username = "admin"
    password = "admin"
    plugin_version = "1"
    logs_enabled = "true"
    log_type_name = "Tomcat Access Logs"
    log_file_path = "/opt/*tomcat*/logs/*access*.txt"
  • Follow the steps in this article to learn how to run the Python script on a Windows server. You don't need to do this for Linux.
  • Move the tomcat folder to the Site24x7 server monitoring plugin directory.

    For Linux: /opt/site24x7/monagent/plugins/

    For Windows: C:\Program Files (x86)\Site24x7\WinAgent\monitoring\plugins\

The agent will automatically execute the plugin within five minutes and display the performance data in Site24x7.
To view the plugin monitor and associated performance charts:
  • Log in to Site24x7.
  • Navigate to Plugins and click the required monitor.

Plugin Contribution

Feel free to contribute to our existing plugin and come up with suggestions or feedback on our Community.

Looking for assistance? We’re here to help!

Want to learn more?

  • Personalized product demo
  • Proof of concept for set up
  • 30-day, unlimited, free trial
Request a Demo

Interested in our services?

  • 24/5 customer support
  • Flexible and competitive pricing
  • Better ROI
Get quote