Monitoring 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 deadlocksgdma_win_tomcat_heapmemusage
: Checks amount of heap memory used by the JVMgdma_win_tomcat_maxtime
: Returns the maximum time in milliseconds taken to fulfill a requestgdma_win_tomcat_threadsbusy
: Returns the current number of threads processing active requests
Implementation
GroundWork server:
- Login to the command line of the GroundWork server as the user used to install GroundWork Monitor 8.
Change to the
gw8
directory:cd gw8
- Download the attached Tomcat profile: service-profile-gdma-win-tomcat.xml
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/
- 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:
- 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
- Host profile name:
- 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:
- Don't forget to perform Commit and Build externals operations once the agent has been installed.
- Follow the steps in the article How to install and configure GDMA.
- On the Tomcat server:
- Deploy the web application
jolokia.war
, included with GDMA in theC:\Program Files (x86)\groundwork\gdma\libexec\jmx4perl\lib\
directory. In the
CATALINA_HOME$\conf\tomcat-users.xml
file, create thejolokia
role and thegwos
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.
- Deploy the web application
GroundWork transitions:
Now, you can adjust the arguments in each service to suit your environment and preference.
- 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. - 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
, andgdma_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 thejolokia
role, then the warning and critical thresholds.http://localhost:8080/jolokia!gwosuser!gwospassword!30!50