Munin - アラート通知メールの設定2010/05/05 |
|
Munin のプラグインのいくつかは閾値が設定されており、この閾値を超えた際にコマンドを実行するよう設定できます。
これを利用して、アラート通知メールを送信できます。
|
|
| [1] | メール送信の設定 |
|
[root@master ~]#
vi /etc/munin/munin.conf # 58行目:追記
contact.email.command mail -s "Munin-notification for ${var:host}" root
# 強制的に通知メールを送信させてみる [root@master ~]# su - munin --shell=/bin/bash -c "/usr/share/munin/munin-limits --contact email --force"
# 以下のようなメールが送信されてくる
From munin@master.srv.world Sat Jun 18 01:54:15 2011
Return-Path: <munin@master.srv.world>
X-Original-To: root
Delivered-To: root@master.srv.world
Date: Sat, 18 Jun 2011 01:54:14 +0900
To: root@master.srv.world
Subject: Munin-notification for master.srv.world
User-Agent: Heirloom mailx 12.4 7/29/08
Content-Type: text/plain; charset=us-ascii
From: munin@master.srv.world (Munin user)
Status: R
srv.world :: master.srv.world :: Disk usage in percent
OKs: / is 5.99, /boot is 14.05, /dev/shm is 0.00.
srv.world :: master.srv.world :: Inode usage in percent
OKs: / is 2.00, /boot is 1.00, /dev/shm is 1.00.
srv.world :: master.srv.world :: File table usage
OKs: open files is 864.00.
srv.world :: master.srv.world :: Munin processing time
OKs: munin update is 4.43, munin graph is 4.00.
srv.world :: master.srv.world :: eth2 errors
OKs: packets is 0.00, packets is 0.00.
|
| [2] | 閾値の設定は [ plugin_name.field_name.(warning | critical) 値 ] という書式になっています。 plugin_name や field_name はグラフを見れば書いてあります。以下は設定の一例です。 |
|
[root@master ~]#
vi /etc/munin/munin.conf # 対象ノードに閾値設定 [node01.srv.world] address 10.0.0.101 use_node_name yes # システム関連でCPU使用率が80%で黄信号、90%で赤信号 cpu.system.warning 80 cpu.system.critical 90 # ルートボリューム使用率が80%で黄信号、90%で赤信号 df._dev_mapper_VolGroup_lv_root.warning 80 df._dev_mapper_VolGroup_lv_root.critical 80 # ログインユーザーが10で黄信号、20で赤信号 users.tty.warning 10 users.tty.critical 20 |
| Sponsored Link |
|
|