apache2: Richte munin-Überwachung ein
This commit is contained in:
parent
85852da70a
commit
25e4165241
6 changed files with 56 additions and 0 deletions
3
files/server-status.conf
Normal file
3
files/server-status.conf
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<VirtualHost *:80>
|
||||||
|
ServerName localhost
|
||||||
|
</VirtualHost>
|
|
@ -3,3 +3,8 @@
|
||||||
service:
|
service:
|
||||||
name: apache2
|
name: apache2
|
||||||
state: reloaded
|
state: reloaded
|
||||||
|
|
||||||
|
- name: restart munin-node
|
||||||
|
service:
|
||||||
|
name: munin-node
|
||||||
|
state: restarted
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
---
|
---
|
||||||
- import_tasks: packages.yml
|
- import_tasks: packages.yml
|
||||||
|
tags: packages
|
||||||
|
|
||||||
- import_tasks: configuration.yml
|
- import_tasks: configuration.yml
|
||||||
|
tags: configuration
|
||||||
|
|
||||||
|
- import_tasks: monitoring.yml
|
||||||
|
tags: monitoring
|
||||||
|
|
35
tasks/monitoring.yml
Normal file
35
tasks/monitoring.yml
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
---
|
||||||
|
- name: "monitoring | Aktiviere Apache-Module"
|
||||||
|
apache2_module:
|
||||||
|
name: status
|
||||||
|
state: present
|
||||||
|
notify: reload apache2
|
||||||
|
|
||||||
|
- name: "monitoring | Kopiere Konfigurationsdatei"
|
||||||
|
copy:
|
||||||
|
src: server-status.conf
|
||||||
|
dest: /etc/apache2/sites-available/server-status.conf
|
||||||
|
|
||||||
|
- name: "monitoring | Aktiviere Seitenkonfiguration für Localhost"
|
||||||
|
file:
|
||||||
|
src: /etc/apache2/sites-available/server-status.conf
|
||||||
|
dest: /etc/apache2/sites-enabled/server-status.conf
|
||||||
|
state: link
|
||||||
|
notify: reload apache2
|
||||||
|
|
||||||
|
- name: "monitoring | Kopiere Munin-Konfiguration"
|
||||||
|
template:
|
||||||
|
src: munin.j2
|
||||||
|
dest: /etc/munin/plugin-conf.d/yyy-apache
|
||||||
|
notify: restart munin-node
|
||||||
|
|
||||||
|
- name: "monitoring | Aktiviere Munin-Plugins"
|
||||||
|
file:
|
||||||
|
src: "/usr/share/munin/plugins/{{ item }}"
|
||||||
|
dest: "/etc/munin/plugins/{{ item }}"
|
||||||
|
state: link
|
||||||
|
loop:
|
||||||
|
- apache_accesses
|
||||||
|
- apache_processes
|
||||||
|
- apache_volume
|
||||||
|
notify: restart munin-node
|
|
@ -3,3 +3,4 @@
|
||||||
apt:
|
apt:
|
||||||
pkg:
|
pkg:
|
||||||
- apache2
|
- apache2
|
||||||
|
- libwww-perl
|
||||||
|
|
6
templates/munin.j2
Normal file
6
templates/munin.j2
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[apache*]
|
||||||
|
env.url http://localhost/server-status?auto
|
||||||
|
{% if inventory_hostname == "orwell" %}
|
||||||
|
env.ports 443
|
||||||
|
{% endif %}
|
||||||
|
env.showfree 1
|
Loading…
Reference in a new issue