Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

It would be great if anyone can share a working configuration for the tomcat_ plugin of munin. I need to monitor several tomcat instances on one machine.

So far I can't figure out:

  • which are the available metrics for the tomcat_ plugin? (documentation is quite poor - at least what I've managed to find)
  • how to configure it correctly?
share|improve this question

3 Answers 3

up vote 7 down vote accepted

share my experiences,hope it helps

step1: enable tomcat plugins

sudo ln -s /usr/share/munin/plugins/tomcat_access /etc/munin/plugins/tomcat_access
sudo ln -s /usr/share/munin/plugins/tomcat_jvm /etc/munin/plugins/tomcat_jvm
sudo ln -s /usr/share/munin/plugins/tomcat_threads /etc/munin/plugins/tomcat_threads
sudo ln -s /usr/share/munin/plugins/tomcat_volume /etc/munin/plugins/tomcat_volume

step2: config tomcat manager status page where the plugin read info from

edit tomcat-users.xml and add

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

access http://munin:munin@localhost:8080/manager/status?XML=true to see if it works. check official document for details:Manager App HOW-TO

step3: config tomcat plugins

edit /etc/munin/plugin-conf.d/munin-node and add

[tomcat_*]
env.ports 8080
env.user munin
env.password munin

step4: local check

run and check messages.

/etc/munin/plugins/tomcat_jvm

normally you need install simple xml support,

sudo apt-get install libxml-simple-perl
#OR
sudo yum install perl-XML-Simple

step5: update munin node

sudo /etc/init.d/munin-node restart

check you graphics, it should works.

share|improve this answer
    
Thank you for the instructions, I still hadn't the chance to check it out and verify your answer, but I'll mark the question as answered. If problems appear, I'll add to the discussion. –  Vladimir Tsvetkov Jan 11 '12 at 11:28
    
Perfect for me. Thank you –  Collin Peters May 7 '12 at 21:42

I don't have enough reputation to add a comment to @Michael's answer above, so I'm adding as an answer - First, it's a great answer! However, when you mention manually running and checking using "/etc/munin/plugins/tomcat_jvm," this doesn't pick up the environment variables from /etc/munin/plugin-conf.d/munin-node (i.e. user/password), so it fails. The correct way is to use munin-run:

$ sudo /etc/munin/plugins/tomcat_jvm
free.value U
used.value U
max.value U

$ sudo munin-run tomcat_jvm
free.value 13894584
used.value 40762440
max.value 1073741824

Also, I'm running Tomcat 7 and some of the tomcat plugins expect connectors with the name of the form http-${PORT} but my connectors are of the form http-apr-${PORT} so I also needed to add this to the [tomcat_*] stanza of munin-node:

env.connector "http-apr-8081"
share|improve this answer

My reputation doesn't allow commenting, but correct env.connector is crucial for other plugins than tomcat_jvm. In my case I needed to drop quotation marks ("), i.e.

 env.connector jk-127.0.0.1-8009

If you can't find the correct connector name, try either

$ lynx http://localhost:8080/manager/html

or

$ curl http://localhost:8080/manager/status?XML=true -u munin:munin | grep connector

Also note, that in tomcat 6.0.30 or later, the roles for manager are more fine-grained. I haven't yet tried myself, but according to the documentation role manager-status in tomcat-users.xml should work in this case.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.