muninでしきい値を超えた時にメールを送れるようなので設定してみました。
<環境>
Centos 6.3
Munin version 2.0
ハードディスク容量でテストしてみます
今の状態は
# munin-run df
_dev_vda3.value 2.72093653752988
_dev_shm.value 0.0282237832413447
_dev_vda1.value 21.9097563361532
設定を確認
# munin-run df config
graph_title Disk usage in percent
graph_args --upper-limit 100 -l 0
graph_vlabel %
graph_scale no
graph_category disk
_dev_vda3.label /
_dev_vda3.warning 92
_dev_vda3.critical 98
_dev_shm.label /dev/shm
_dev_shm.warning 92
_dev_shm.critical 98
_dev_vda1.label /boot
_dev_vda1.warning 92
_dev_vda1.critical 98
設定を変えます
# vim /etc/munin/munin.config
+ contact.email.command mail -s "Munin ${var:host}" sample@example.com
+ contact.email.max_messages 10
+ contact.email.always_send warning critical
[localhost]
address 127.0.0.1
use_node_name yes
+ df._dev_vda3.warning 1
+ df._dev_vda3.critical 2
テストメールを送ってみる
sudo -u munin sh -c "/usr/share/munin/munin-limits --contact email --force"
下記のようなメールが届きます
localhost :: localhost :: Disk usage in percent
OKs: /boot is 21.91, /dev/shm is 0.03, / is 2.72.
localhost :: localhost :: Connections through firewall
OKs: Total is 14.00.
localhost :: localhost :: Inode usage in percent
OKs: /boot is 0.07, /dev/shm is 0.04, / is 1.62.
localhost :: localhost :: File table usage
OKs: open files is 1184.00.
localhost :: localhost :: Disk latency per device :: Average latency for /dev/vda
OKs: Read IO Wait time is 0.02, Write IO Wait time is 0.00.
localhost :: localhost :: eth0 errors
OKs: errors is 0.00, errors is 0.00.
しきい値は、いい値に変更してください