Prechádzať zdrojové kódy

Make possible to add munin alerts for heavy load and high swap usage

Emmanuel Bouthenot 10 rokov pred
rodič
commit
fe38e0fa0e

+ 2 - 2
roles/monitoring/templates/munin/munin-node.conf.plugins.j2

@@ -38,8 +38,8 @@ user root
 
 [df*]
 env.exclude none unknown iso9660 squashfs udf romfs ramfs debugfs
-env.warning 92
-env.critical 98
+env.warning 85
+env.critical 95
 
 [exim_mailqueue]
 group adm, (Debian-exim)

+ 22 - 1
roles/monitoring/templates/munin/munin.conf.j2

@@ -55,7 +55,10 @@ includedir /etc/munin/munin-conf.d
 # something changes (OK -> WARNING, CRITICAL -> OK, etc)
 #contact.someuser.command mail -s "Munin notification" somejuser@fnord.comm
 #contact.anotheruser.command mail -s "Munin notification" anotheruser@blibb.comm
-#
+contacts root
+contact.root.command mail -s 'MUNIN – [${var:host}] ~ ${var:graph_title}' root
+contact.root.always_send warning critical
+
 # For those with Nagios, the following might come in handy. In addition,
 # the services must be defined in the Nagios server as well.
 #contact.nagios.command /usr/bin/send_nsca nagios.host.comm -c /etc/nsca.conf
@@ -73,6 +76,24 @@ includedir /etc/munin/munin-conf.d
 {% if node.port is defined %}
     port {{ node.port }}
 {% endif %}
+{% if munin_load_warning is defined %}
+    load.load.warning {{ munin_load_warning }}
+{% endif %}
+{% if munin_load_critical is defined %}
+    load.load.critical {{ munin_load_critical }}
+{% endif %}
+{% if munin_swap_warning is defined %}
+    memory.swap.warning {{ munin_swap_warning }}
+{% endif %}
+{% if munin_swap_critical is defined %}
+    memory.swap.critical {{ munin_swap_critical }}
+{% endif %}
+{% if munin_postfix_mailqueue_warning is defined %}
+    postfix_mailqueue.deferred.warning {{ munin_postfix_mailqueue_warning }}
+{% endif %}
+{% if munin_postfix_mailqueue_critical is defined %}
+    postfix_mailqueue.deferred.critical {{ munin_postfix_mailqueue_critical }}
+{% endif %}
 {% endfor %}
 {% endif %}