Fix the javamelody installation on tomcat.

This commit is contained in:
Andrea Dell'Amico 2019-09-04 18:25:31 +02:00
parent b33cd02b66
commit af6fac7a36
3 changed files with 116 additions and 6 deletions

View File

@ -501,10 +501,57 @@
--> -->
{% if tomcat_javamelody %} {% if tomcat_javamelody %}
<!-- Filter that enables javamelody metrics globally --> <!--==== Monitoring ====-->
<!-- Custom CSS
<filter>
<filter-name>customResourceFilter</filter-name>
<filter-class>net.bull.javamelody.CustomResourceFilter</filter-class>
<init-param>
<param-name>monitoring.css</param-name>
<param-value>/styles/monitoring.css</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>customResourceFilter</filter-name>
<url-pattern>/monitoring</url-pattern>
</filter-mapping>
-->
<!-- Monitor filter -->
<filter> <filter>
<filter-name>javamelody</filter-name> <filter-name>javamelody</filter-name>
<filter-class>net.bull.javamelody.MonitoringFilter</filter-class> <filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
<!--
<init-param>
<param-name>storage-directory</param-name>
<param-value>logs/monitoring</param-value>
</init-param>
<init-param>
<param-name>monitoring-path</param-name>
<param-value>/monitoring</param-value>
</init-param>
-->
<init-param>
<param-name>log</param-name>
<param-value>true</param-value>
</init-param>
<!--
<init-param>
<param-name>url-exclude-pattern</param-name>
<param-value>(/images/.*|/js/.*|/styles/.*)</param-value>
</init-param>
<init-param>
<param-name>admin-emails</param-name>
<param-value>first.last@example.com</param-value>
</init-param>
<init-param>
<param-name>mail-session</param-name>
<param-value>MailSession</param-value>
</init-param>
<init-param>
<param-name>mail-periods</param-name>
<param-value>week,month</param-value>
</init-param>
-->
</filter> </filter>
<filter-mapping> <filter-mapping>
<filter-name>javamelody</filter-name> <filter-name>javamelody</filter-name>

View File

@ -79,12 +79,28 @@
when: tomcat_version >= 8 when: tomcat_version >= 8
tags: [ 'tomcat', 'tomcat_javamelody' ] tags: [ 'tomcat', 'tomcat_javamelody' ]
- name: Install the javamelody war if the javamelody support is enabled - name: Install the javamelody dependency jar into the Java shared libs directory
maven_artifact: artifact_id=javamelody-core version=latest group_id=net.bull.javamelody extension=jar dest={{ tomcat_catalina_home_dir }}/lib/javamelody-core.jar verify_checksum=always mode=0644 owner=root group=root maven_artifact: artifact_id=jrobin version=latest group_id=org.jrobin extension=jar dest=/usr/share/java/jrobin.jar verify_checksum=always mode=0644 owner=root group=root
when: tomcat_javamelody when: tomcat_javamelody
tags: [ 'tomcat', 'tomcat_javamelody' ] tags: [ 'tomcat', 'tomcat_javamelody' ]
- name: Remove the javamelody war if the javamelody support is disabled - name: Install the javamelody-core jar into the Java shared libs directory
file: dest={{ tomcat_catalina_home_dir }}/lib/javamelody-core.jar state=absent maven_artifact: artifact_id=javamelody-core version={{ tomcat_javamelody_version }} group_id=net.bull.javamelody extension=jar dest=/usr/share/java/javamelody-core.jar verify_checksum=always mode=0644 owner=root group=root
when: tomcat_javamelody
tags: [ 'tomcat', 'tomcat_javamelody' ]
- name: Create a link to the the javamelody jar and its dependencies if the javamelody support is enabled
file: src=../../java/{{ item }} dest={{ tomcat_catalina_home_dir }}/lib/{{ item }} state=link owner=root group=root mode=0644
with_items:
- javamelody-core.jar
- jrobin.jar
when: tomcat_javamelody
tags: [ 'tomcat', 'tomcat_javamelody' ]
- name: Remove the javamelody jar and its dependencies if the javamelody support is disabled
file: dest={{ tomcat_catalina_home_dir }}/lib/{{ item }} state=absent
with_items:
- javamelody-core.jar
- jrobin.jar
when: not tomcat_javamelody when: not tomcat_javamelody
tags: [ 'tomcat', 'tomcat_javamelody' ] tags: [ 'tomcat', 'tomcat_javamelody' ]

View File

@ -501,10 +501,57 @@
--> -->
{% if tomcat_javamelody %} {% if tomcat_javamelody %}
<!-- Filter that enables javamelody metrics globally --> <!--==== Monitoring ====-->
<!-- Custom CSS
<filter>
<filter-name>customResourceFilter</filter-name>
<filter-class>net.bull.javamelody.CustomResourceFilter</filter-class>
<init-param>
<param-name>monitoring.css</param-name>
<param-value>/styles/monitoring.css</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>customResourceFilter</filter-name>
<url-pattern>/monitoring</url-pattern>
</filter-mapping>
-->
<!-- Monitor filter -->
<filter> <filter>
<filter-name>javamelody</filter-name> <filter-name>javamelody</filter-name>
<filter-class>net.bull.javamelody.MonitoringFilter</filter-class> <filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
<!--
<init-param>
<param-name>storage-directory</param-name>
<param-value>logs/monitoring</param-value>
</init-param>
<init-param>
<param-name>monitoring-path</param-name>
<param-value>/monitoring</param-value>
</init-param>
-->
<init-param>
<param-name>log</param-name>
<param-value>true</param-value>
</init-param>
<!--
<init-param>
<param-name>url-exclude-pattern</param-name>
<param-value>(/images/.*|/js/.*|/styles/.*)</param-value>
</init-param>
<init-param>
<param-name>admin-emails</param-name>
<param-value>first.last@example.com</param-value>
</init-param>
<init-param>
<param-name>mail-session</param-name>
<param-value>MailSession</param-value>
</init-param>
<init-param>
<param-name>mail-periods</param-name>
<param-value>week,month</param-value>
</init-param>
-->
</filter> </filter>
<filter-mapping> <filter-mapping>
<filter-name>javamelody</filter-name> <filter-name>javamelody</filter-name>