0

on a Ubuntu 12.04 server I´ve installed munin and setup tomcat plugins following this thread. The Only Graphs that fills is JVM Memory all others (access,threads, volume stay empty)

If i test

sudo /etc/munin/plugins/tomcat_access autoconf

I get no (no tomcat status)

I think something wrong with my connectory. Checking tomcat status I see following:

ajp-bio-8009
http-bio-8080

in /etc/munin/plugin-conf.d/munin-node

I have

[tomcat_*]
env.ports 8080
env.user munin
env.password pass
env.connector ajp-bio-8009

What am I doing wrong?

edit: find here output of ss -lnt

State       Recv-Q Send-Q   Local Address:Port      Peer Address:Port 
LISTEN      0      100      :::8009                 :::*     
LISTEN      0      32       *:201                   *:*     
LISTEN      0      100      :::8080                 :::*     
LISTEN      0      50       :::54992                :::*     
LISTEN      0      128      *:80                    *:*     
LISTEN      0      50       :::36596                :::*     
LISTEN      0      128      :::4949                 :::*     
LISTEN      0      128      ::22                    :::*     
LISTEN      0      128      *:22                    *:*     
LISTEN      0      128      :::5432                 :::*     
LISTEN      0      128      *:5432                  *:*     
LISTEN      0      100      :::25                   :::*     
LISTEN      0      100      *:25                    *:*     
LISTEN      0      128      *:443                   *:*     
LISTEN      0      50       :::8030                 :::*     
LISTEN      0      1        ::ffff:127.0.0.1:8005   :::*     
toni
  • 139
  • 6

1 Answers1

0

I setup a conf (I assumed you are using tomcat7), it turns out that

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

this is not valid anymore, that's for tomcat6.

Now you have to use one of these :

manager-gui - allows access to the HTML GUI and the status pages
manager-script - allows access to the text interface and the status pages
manager-jmx - allows access to the JMX proxy and the status pages
manager-status - allows access to the status pages only

It turns out that my conf works with

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

You should also edit your file /etc/munin/plugin-conf.d/munin-node to

[tomcat_*]
env.ports 8080
env.user munin
env.password pass
env.connector "ajp-bio-8009"

And to test it run (sudo) munin-run tomcat_access for example.

Pierre-Alain TORET
  • 1,244
  • 7
  • 14
  • Hi pat, thanks a million for this. Good Point! unfortunately your conf looks like mine I respected manager-status for tomcat7. Is there some log to see if tomcat quits for example with a 403 when munin asks for content? – toni Nov 02 '15 at 16:04
  • Ah too bad ! You can check in the logs, in my conf it's in `logs/localhost_access_log.2015-11-02.txt`. I get requests like `127.0.0.1 - munin [02/Nov/2015:17:04:32 +0100] "GET /manager/status?XML=true HTTP/1.1" 200 2687` – Pierre-Alain TORET Nov 02 '15 at 16:06
  • Another good one. But I see a 200 ;( `127.0.0.1 - munin [02/Nov/2015:16:05:07 +0000] "GET /manager/status?XML=true HTTP/1.1" 200 25646` buff but why did it stop at 16:05:07 I´m going nuts with this … – toni Nov 02 '15 at 16:11
  • is your munin-node running at the moment ? – Pierre-Alain TORET Nov 02 '15 at 16:15
  • `munin-node start/running, process 2288` yep the thing what I do not understand is why `sudo /etc/munin/plugins/tomcat_access autoconf` gives `no status` It smells like some authorization problem. Next Idea, `/var/log/munin/munin-node.log` does not show any problems. Last Idea maybe mod_security is blocking access. I will disable it for a moment – toni Nov 02 '15 at 16:21
  • ah I have something different I get yes when I run `/etc/munin/plugins/tomcat_access autoconf` – Pierre-Alain TORET Nov 02 '15 at 16:23
  • to bad mod_security wasn´t the bad guy either. – toni Nov 02 '15 at 16:24
  • Can you access `http://your.tomcat.ip/manager/status?XML=true` ? in a browser ? – Pierre-Alain TORET Nov 02 '15 at 16:26
  • added some more details in my answer. – Pierre-Alain TORET Nov 02 '15 at 16:34
  • I can visit status page with lynx like: `lynx http://localhost:8080` when trying: lynx `http://localhost:8080/manager/status?XML=true ` I have to authorize. When providing the user/pass I setup at start the page says I can navigate with arrows but it seems there is no content to navigate. BUT when I visit the first link and click on status-page I get HTML results which tell memory usage, access etc. It looks like somehing is not correct with the XML output?! – toni Nov 02 '15 at 16:38
  • you can try with curl : `curl http://username:password@localhost:8080/manager/status?XML=true` by replacing username and password by your manager ones. You should get some XML output. If there's output, then you shouldn't have any issue. – Pierre-Alain TORET Nov 02 '15 at 16:40
  • Ahh yes. with curl I´m getting an XML document which looks like it holds needed data. `` the document looks a bit odd as it has a lot of html_entites in it `remoteAddr="?" virtualHost="?"` I´ve changed the connector "…" and `sudo munin-run tomcat_access` says: accesses.value U – toni Nov 02 '15 at 16:44
  • what if you put "http-bio-8080" instead ? if you get a value instead of U, it means it's working. In that case just restart your munin-node and give munin some time to gather the stats. – Pierre-Alain TORET Nov 02 '15 at 16:46
  • No change ;( `sudo /etc/munin/plugins/tomcat_access autoconf no (no tomcat status)` I really value all of your ideas. But more and more I think the problem lays somewhere else. Not nice but now the box has to get the whip `sudo reboot` :)) – toni Nov 02 '15 at 16:51
  • Thanks ! Good luck then :), I have to say I'm sort of running out of ideas now. – Pierre-Alain TORET Nov 02 '15 at 17:05
  • Hey pat, one last Idea. In '/etc/munin/plugins/tomcat_access' i read `A munin-user in $CATALINA_HOME/conf/tomcat-users.xml` should be set up for this to work. now when checking `$ echo $CATALINA_HOME` it´s empty. may it´s possible that I simply used the wrong tomcat-users.xml `/var/tomcat/conf/tomcat-users.xml`? – toni Nov 02 '15 at 18:05
  • No it's just that this variable is valued when you start the server. You don't have it in yiut regular env and it makes sense. – Pierre-Alain TORET Nov 02 '15 at 18:24
  • pat just wanted to post an update. Our Java guy found the problem. the reason is dead simple. The munin installation is far outdated thus it does not support the tomcat7 connector … – toni Nov 03 '15 at 16:45
  • ahaa, which version were you using ? good that's it working now, so was your conf good from the beginning ? – Pierre-Alain TORET Nov 03 '15 at 16:51
  • yes the conf was correct ;( the munin version was 1.4.6 together with tomcat7. Thanks again… – toni Nov 04 '15 at 06:20