Munin : メール通知の設定2016/06/06 |
|
監視対象となる項目はプラグインで設定します。CPU 使用率等の主要なプラグインはデフォルトで有効、且つ、しきい値も設定されていますが、
このしきい値に対して、値を超えた際にコマンドを実行するよう設定することができます。この機能を利用して通知メールを送信するも可能です。
|
|
| [1] | root 宛てに通知メールを送信するよう設定します。 |
|
root@dlp:~#
vi /etc/munin/munin.conf # 96行目あたりに追記
contact.email.command mail -s "Munin-notification for ${var:group}::${var:host}" root
# 試しに通知メールを強制送信 root@dlp:~# su - munin --shell=/bin/bash -c "/usr/share/munin/munin-limits --contact email --force"
# 以下のようなメールが送信されてくる
From: munin@dlp.srv.world (munin application user)
srv.world :: dlp.srv.world :: Inode usage in percent
OKs: / is 6.20, /run/user/0 is 0.00, /run/lock is 0.00, /boot is 0.24, /
run is 0.11, /sys/fs/cgroup is 0.00, /dev is 0.09, /dev/shm is 0.00.
srv.world :: dlp.srv.world :: ens3 errors
OKs: errors is 0.00, errors is 0.00.
srv.world :: dlp.srv.world :: File table usage
OKs: open files is 736.00.
srv.world :: dlp.srv.world :: Disk usage in percent
OKs: / is 7.44, /run/user/0 is 0.00, /run/lock is 0.00, /boot is 22.57,
/run is 1.42, /sys/fs/cgroup is 0.00, /dev/shm is 0.00.
srv.world :: dlp.srv.world :: Disk latency per device :: Average latency for /de
v/ubuntu-vg/root
OKs: Read IO Wait time is 0.00, Write IO Wait time is 0.01.
srv.world :: dlp.srv.world :: Disk latency per device :: Average latency for /de
v/vda
OKs: Write IO Wait time is 0.01, Read IO Wait time is 0.00.
srv.world :: dlp.srv.world :: Disk latency per device :: Average latency for /de
v/ubuntu-vg/swap_1
OKs: Read IO Wait time is 0.00, Write IO Wait time is 0.00.
srv.world :: dlp.srv.world :: Munin processing time
UNKNOWNs: munin graph is unknown.
OKs: munin update is 4.59.
|
| [2] | メール送信ではなく、ファイルに書き出す場合は以下のように設定します。 |
|
root@dlp:~#
vi /etc/munin/munin.conf # 96行目あたりに追記
contact.log.command tee -a /var/log/munin/alert.log
|
| Sponsored Link |
|
|