Monitoring Tomcat with Windows GDMA

REDIRECT: This URL has changed to https://support8.gwos.com/gw/gw8/latest/how-to-s/how-to-monitor-tomcat-with-windows-gdma
Click the link above if you are not automatically redirected in 10 seconds.

Description

This service profile monitors a Tomcat server using Windows GDMA. The checks provide a view of memory availability and let you know how well your system is doing at handling client requests, which are some of the most important things you need to monitor.

Profile package

Profile definition:

  • service-profile-gdma-win-tomcat.xml

Service checks:

  • gdma_win_tomcat_deadlocks : Checks for any current deadlocks
  • gdma_win_tomcat_heapmemusage : Checks amount of heap memory used by the JVM
  • gdma_win_tomcat_maxtime : Returns the maximum time in milliseconds taken to fulfill a request
  • gdma_win_tomcat_threadsbusy : Returns the current number of threads processing active requests

Implementation

GroundWork server:

  1. Login to the command line of the GroundWork server as the user used to install GroundWork Monitor 8.
  2. Change to the gw8 directory:

    cd gw8
  3. Download the attached Tomcat profile: service-profile-gdma-win-tomcat.xml
  4. Copy the profile to the monarch container on your GroundWork server:

    docker cp service-profile-gdma-win-tomcat.xml dockergw8_monarch_1:/usr/local/groundwork/monarch/profiles/Uploaded/
  5. In the GroundWork Monitor UI, import the profiles in the Uploaded folder:
    • Go to Configuration > Nagios Monitoring > Profiles > Profile Importer > Import > Uploaded.
    • Click Check all and click Import.

Tomcat server:

  1. On the Tomcat server, install GDMA 2.7.1:
    • Follow the steps in the article How to install and configure GDMA.
      • Make sure, when you get to step 2.k. GDMA profiles in the section Install the agent (Windows), that you leave the host profile as is and add the entry for the service profile:
        • Host profile name: gdma-windows-host
        • Service profile name: gdma-win-tomcat
    • Don't forget to perform Commit and Build externals operations once the agent has been installed.
  2. On the Tomcat server:
    • Deploy the web application jolokia.war, included with GDMA in the C:\Program Files (x86)\groundwork\gdma\libexec\jmx4perl\lib\ directory.
    • In the CATALINA_HOME$\conf\tomcat-users.xml file, create the jolokia role and the gwos user: 

      <role rolename="jolokia"/>
      <user username="gwos" password="gwos" roles="jolokia"/>

      While the role must be jolokia, the username and password can be adjusted to your preference.

GroundWork transitions:

Now, you can adjust the arguments in each service to suit your environment and preference.

  1. In the GroundWork Monitor UI, go to Configuration > Nagios Monitoring > Hosts > select the host you just created > click the service gdma_win_tomcat_deadlocks > click the Service Check tab.
  2. Under the section Externals Macro Arguments, uncheck Inherit externals arguments from the generic service:
    • The default arguments are as follows, which is first the URL to the Jolokia app on the Tomcat server, then the username and password of the user with the jolokia role:

      http://localhost:8080/jolokia!gwosuser!gwospassword
    • The other checks, gdma_win_tomcat_heapmemusage, gdma_win_tomcat_maxtime, and gdma_win_tomcat_threadsbusy, can be adjusted using the same process, but have thresholds added. First is the URL to the Jolokia app on the Tomcat server, the username and password of the user with the jolokia role, then the warning and critical thresholds.

      http://localhost:8080/jolokia!gwosuser!gwospassword!30!50