Skip to content
Permalink
Browse files

Add initial implementation of Monit Apache stuff.

  • Loading branch information
damiendart committed Jan 5, 2020
1 parent b331693 commit aa07e63a7a0a436617594b341d5d6af0a7afa99e
Showing with 24 additions and 0 deletions.
  1. +1 −0 roles/monitoring/defaults/main.yml
  2. +23 −0 roles/monitoring/templates/monitrc.j2
@@ -5,3 +5,4 @@
# monitoring_email_password: ""
# monitoring_email_username: ""
# monitoring_pushover_api_token: ""
monitoring__monit_apache: false
@@ -17,6 +17,29 @@ set mailserver {{ monitoring_email_hostname }} port 587
username "{{ monitoring_email_username }}" password "{{ monitoring_email_password }}"
using TLSV1 with timeout 30 seconds

{% if monitoring__monit_apache %}
check process apache with pidfile /var/run/apache2/apache2.pid
group www
group apache
start program = "/etc/init.d/apache2 start"
stop program = "/etc/init.d/apache2 stop"
# if children > 250 then restart
if loadavg(5min) greater than 10 for 8 cycles then alert
if failed host localhost port 80 for 2 cycles then restart
if 3 restarts within 20 cycles then alert
if 4 restarts within 20 cycles then timeout
depend apache_bin
depend apache_rc

check file apache_bin with path /usr/sbin/apache2
group apache
include /etc/monit/templates/rootbin

check file apache_rc with path /etc/init.d/apache2
group apache
include /etc/monit/templates/rootbin
{% endif %}

# One day I will do this properly and use the "conf-enabled" thing.
# include /etc/monit/conf-available/apache2
include /etc/monit/conf-available/cron

0 comments on commit aa07e63

Please sign in to comment.
You can’t perform that action at this time.