CentOS 7
Sponsored Link

Munin : メール通知の設定2015/06/11

 
監視対象となる項目はプラグインで設定します。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  Fri Feb 18 20:02:27 2015

srv.world :: dlp.srv.world :: Disk usage in percent
        OKs: /boot is 26.23, / is 8.94, /dev/shm is 0.00.

srv.world :: dlp.srv.world :: Inode usage in percent
        OKs: /boot is 0.05, / is 3.90, /dev/shm is 0.00.

srv.world :: dlp.srv.world :: File table usage
        OKs: open files is 864.00.

srv.world :: dlp.srv.world :: Disk latency per device :: Average latency f
or /dev/vda
        OKs: Read IO Wait time is 0.01, Write IO Wait time is 0.14.

srv.world :: dlp.srv.world :: Disk latency per device :: Average latency f
or /dev/VolGroup/lv_swap
        OKs: Read IO Wait time is 0.00, Write IO Wait time is 0.00.

srv.world :: dlp.srv.world :: Disk latency per device :: Average latency f
or /dev/VolGroup/lv_root
        OKs: Read IO Wait time is 0.01, Write IO Wait time is 0.12.

srv.world :: dlp.srv.world :: eth0 errors
        OKs: errors is 0.00, errors is 0.00.
[2] メール送信ではなく、ファイルに書き出す場合は以下のように設定します。
[root@dlp ~]#
vi /etc/munin/munin.conf
# 96行目あたりに追記

contact.log.command tee -a /var/log/munin/alert.log
関連コンテンツ