Monitoring Tomcat with Munin on Debian GNU/Linux

To monitor Tomcat with Munin 2.0 on Debian GNU/Linux (tested on Debian Squeeze with Tomcat6 and Debian Backports), you need the following steps.

First, you need to install package tomcat6-admin which enables the Tomcat Manager app we will be using.

# apt-get install tomcat6-admin

Next, create a user with a manager role in Tomcat, editing /etc/tomcat6/tomcat-users.xml and adding the following two lines in the appropriate list.

<role rolename="manager"/> <user username="munin" password="Munin" roles="manager"/>

Restart Tomcat to reread its configuration and enable the newly-installed Tomcat Manager app.

# service tomcat6 restart

Configure the Munin tomcat_* plugins adding a file /etc/munin/plugin-conf.d/tomcat with the following content:

[tomcat_*]   env.host 127.0.0.1   env.port 8080   env.user munin   env.password Munin

Enable the tomcat_* plugins:

# cd /etc/munin/plugins/; ln -s /usr/share/munin/plugins/tomcat_* .

Restart Munin node:

# service munin-node restart

Enjoy!