add support to monitor nginx

This commit is contained in:
nd 2018-11-13 00:12:16 +01:00
parent fb90bb6cad
commit c19f5fa226
No known key found for this signature in database
GPG key ID: 21B5CD4DEE3670E9
4 changed files with 29 additions and 0 deletions

8
files/monitoring Normal file
View file

@ -0,0 +1,8 @@
server {
listen 127.0.0.1:5234;
location /nginx_status {
stub_status on;
access_log off;
}
}

View file

@ -1,3 +1,4 @@
--- ---
dependencies: dependencies:
- { role: monitoring }
- { role: pki-server } - { role: pki-server }

View file

@ -32,3 +32,19 @@
- name: delete nginx default config - name: delete nginx default config
file: path=/etc/nginx/sites-enabled/default state=absent file: path=/etc/nginx/sites-enabled/default state=absent
- name: copy nginx status config
copy:
src: monitoring
dest: /etc/nginx/sites-available/monitoring
mode: 0755
notify:
- restart nginx
- name: activate nginx status config
file:
path: /etc/nginx/sites-enabled/monitoring
src: /etc/nginx/sites-available/monitoring
state: link
notify:
- restart nginx

4
vars/main.yml Normal file
View file

@ -0,0 +1,4 @@
monitoring:
checks:
local:
nginx_status: {}