Commit 635939bf authored by Jocelyn Delalande's avatar Jocelyn Delalande

monit : add role

parent 4717d170
monit_emails: []
monit_cycle_duration: 15
monit_enabled_modules: []
\ No newline at end of file
- name: restart monit
service: name=monit state=restarted
- name: Install apt package
apt: pkg=monit update_cache=yes cache_valid_time=1800
- name: Deploy monitrc configuration
src: monitrc.j2
dest: /etc/monit/monitrc
notify: restart monit
- name: Enable monit modules
src: "custom-modules/{{ item }}.j2"
dest: "/etc/monit/conf.d/{{ item }}"
with_items: "{{ monit_enabled_modules }}"
notify: restart monit
\ No newline at end of file
check process nginx with pidfile /var/run/
group www
group nginx
start program = "/etc/init.d/nginx start"
stop program = "/etc/init.d/nginx stop"
#if failed port 80 protocol http request "/" then restart
if 5 restarts with 5 cycles then timeout
if 1 restart with 1 cycle then alert
#{{ ansible_managed }}
set mailserver localhost
set mail-format {from: {{ monit_email_from }} }
{% for email in monit_emails %}
set alert {{ email }}
{% endfor %}
set daemon {{ monit_cycle_duration }}
# Conseillé par Debian :)
set logfile /var/log/monit.log
set idfile /var/lib/monit/id
set statefile /var/lib/monit/state
set eventqueue
basedir /var/lib/monit/events
slots 100
include /etc/monit/conf.d/*
include /etc/monit/conf-enabled/*
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment