windowsへmunin-nodeをインストール
http://sourceforge.net/projects/munin-nodewin32/
ここからダウンロードしてwindows xp sp3へダブルクリックでインストール。
※監視項目を変更する場合、インストール先のフォルダ内のmunin-node.iniを編集。
※監視項目を変更したらサービスの再起動を忘れないこと
xenserverへmunin-nodeをインストール
xenserverにbase,rpmforge,epelのリポジトリを追加(baseがないと駄目だった)
※TCP:4949を開けるのを忘れない。
#yum –enablerepo=rpmforge,base,epel install munin-node
#vi /etc/munin/munin-node.conf 以下の二つを追加
host_name ホスト名.mylines.org
allow ^192.168.XX.XXX$ ←muninサーバのIPアドレスを設定
あとは、munin(server側)の/etc/munin/munin.confに上の二つを追加
[windows.mylines.org]
address 192.168.xxx.xxx
use_node_name yes
[xenserver.mylines.org]
address 192.168.xxx.xxx
use_node_name yes
munin-limitsの設定
参考:http://munin-monitoring.org/wiki/munin.conf
参考:http://castor.s26.xrea.com/blog/2007/10/19
参考:http://www.sdlab.org/wiki/doku.php?id=fedora8-munin
参考:http://www.aska-ltd.jp/techinfo/pukiwiki/index.php?%E3%82%B5%E3%83%BC%E3%83%90%E7%9B%A3%E8%A6%96munin%E3%81%AE%E5%B0%8E%E5%85%A5
vi /etc/munin/munin.conf ##真ん中のcontactsから始まる4行を追加
#contact.nagios.command /usr/bin/send_nsca nagios.host.comm -c /etc/nsca.conf
contact.email.command /bin/mail -s "Munin ${var:group}::${var:host}" root
contact.email.always_send warning critical
contact.email.max_messages 1
contacts email
# a simple host tree
[localhost]
・
・
・
munin.confを保存後に以下のコマンドを入れてメールがrootへ来るか確認。
sudo -u munin sh -c "/usr/share/munin/munin-limits –contact email –force”
メールが来れば、再度munin.confにしきい値を設定する
#munin-run load,cpu,memory,df #どれか選んで実行してvalueを除いたものを入れる。
※[plugin].[field].(warning|critical) value の書式で書く
#vi /etc/munin/munin.conf
[ホスト名.mylines.org]
address 127.0.0.1
use_node_name yes
load.load.warning 2
load.load.critical 5
cpu.user.warning 90
memory.apps.warning 900000000
df._dev_xvda1.warning 80
df._dev_xvda1.critical 90
SMARTCTLによる温度監視
xenserver(munin-node側)に積んであるHDDに対して温度監視する設定
#yum –enablerepo=base install smartmontools
#ln -s /usr/share/munin/plugins/hddtemp_smartctl
/etc/munin/plugins/hddtemp_smartctl
# vi /etc/munin/plugin-conf.d/hddtemp_smartctl #hdd6個あるので追加
[hddtemp_smartctl]
user root
env.drives sda sdb sdc sdd sde sdf
env.type_sda ata
#/etc/rc.d/init.d/munin-node restart
SMARTによるHDD監視
xenserver(munin-node側)に積んであるHDDのSMART値を監視する設定
#yum –enablerepo=base install smartmontools
#ln -s /usr/share/munin/plugins/smart_ /etc/munin/plugins/smart_sda
#ln -s /usr/share/munin/plugins/smart_ /etc/munin/plugins/smart_sdb
#ln -s /usr/share/munin/plugins/smart_ /etc/munin/plugins/smart_sdc
#ln -s /usr/share/munin/plugins/smart_ /etc/munin/plugins/smart_sdd
#ln -s /usr/share/munin/plugins/smart_ /etc/munin/plugins/smart_sde
#ln -s /usr/share/munin/plugins/smart_ /etc/munin/plugins/smart_sdf
# vi /etc/munin/plugin-conf.d/munin-node
[smart_sd*]
user root
env.drives sda sdb sdc sdd sde sdf
env.type ata
#munin-run smart_sda #smart_sdaがちゃんと動くかテスト
Raw_Read_Error_Rate.value 200
smartctl_exit_status.value 0
Traceback (most recent call last):
File "/etc/munin/plugins/smart_sde", line 398, in ?
exit(0)
TypeError: ‘str’ object is not callable
#vi /usr/share/plugins/smart_ #修正
398行目を修正
exit(0)
↓
sys.exit(0)
# /etc/rc.d/init.d/munin-node restart
mdadm-raidの監視
参考:http://wb.cocolog-nifty.com/blog/2010/06/muninraid-bb42.html
Plugin raid version2 (munin-exchangeが落ちてるのでgoogleキャッシュから拾ってきた・・・。)
#vi raid #拾ってきたキャッシュからコピペ
#chmod 755 raid
#mv raid /usr/share/munin/plugins/raid
#ln –s /usr/share/munin/plugins/raid /etc/munin/plugins/raid
#munin-run raid
Name "main::rcpt" used only once: possible typo at /etc/munin/plugins/raid
md2.value 100
md2_rebuild.value 100
md1.value 100
md1_rebuild.value 100
#vi /usr/share/munin/plugins/raid
71行目を修正
$rcpt = 0;
↓
$rpct = 0;
# /etc/rc.d/init.d/munin-node restart
メール通知させるためmunin(サーバー側)に追加。
#vi /etc/munin/munin.conf
[localhost]
address 127.0.0.1
use_node_name yes
raid.md1.critical 99:
raid.md2.critical 99:
raid.md1_rebuild.warning 99:
raid.md2_rebuild.warning 99: