4

Hi i've followed several guides about configuring tomcat plugin on a munin node but all of them was for tomcat 6 although i did neccessary corrections in tomcat-users.xml and whatnot, i couldn't get any data from the plugin.

Is there anyone who did this for Tomcat 8?

Edit : The steps i've followed :

Create symlinks :

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

Edit tomcat-users.xml :

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

Create manager.xml :

<Context privileged="true" antiResourceLocking="false"
         docBase="${catalina.home}/webapps/manager">
  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="127\.0\.0\.1" />
</Context>

Edit munin-node conf in plugin-conf.d :

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

Run plugins :

munin-run tomcat_access

Restart munin node :

sudo service munin-node restart

Did I miss something?

chicks
  • 3,639
  • 10
  • 26
  • 36
  • Please don't edit the answer into your question. [sf] is a question and answer site and answers should be separate from questions. You can [answer your own question](http://serverfault.com/help/self-answer) instead. – DavidPostill Feb 27 '17 at 13:28
  • Alright will do that instead, sorry. Answered and edit approved. – Mustafa Yılmaz Feb 27 '17 at 13:48

1 Answers1

0

Finally found myself a solution :

What I did was create a manager.xml in $CATALINA_BASE/conf/Catalina/localhost and add these inside :

<Context privileged="true" antiResourceLocking="false"
         docBase="${catalina.home}/webapps/manager">
    <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />
</Context>

Of course, you need to change the "allow" section however you want, if you need to access from a remote host you should write the ip there.

After this in $CATALINA_BASE/conf/context.xml I commented out this line :

<!-- <Valve className="org.apache.catalina.authenticator.SSLAuthenticator" securePagesWithPragma="false" />-->

I absolutely don't know what this will cause but it let me login into the manager page.

Finally added these to the munin-node configuration :

env.host 127.0.0.1
env.request /manager/status?XML=true
env.ports 8080
env.connector "http-nio-8080"

You can find the correct connector in the manager web page. Hope this helps someone else too.

chicks
  • 3,639
  • 10
  • 26
  • 36