CentOS5.6にmuninをインストールしてみる

先日サーバ監視ツールとしてzabbixをインストールしたが、muninの方が項目が多くて良いとの噂を聞いたので入れてみた


yumでインストール

yum update
yum install munin munin-node


muninのエージェントを起動して、自動起動を設定

/etc/rc.d/init.d/munin-node start
/sbin/chkconfig munin-node on
/sbin/chkconfig --list munin-node


/var/www/html/munin にインストールされているので、apacheのバーチャルホストで適当なドメイン(munin.example.com)に割り当ててやる

後はmunin.example.comにアクセスすれば、各監視状況のグラフが見れる



簡単すぎてふいたw


mysql用のプラグインを設定

ln -s /usr/share/munin/plugins/mysql_bytes /etc/munin/plugins/mysql_bytes
ln -s /usr/share/munin/plugins/mysql_isam_space_ /etc/munin/plugins/mysql_isam_space_
ln -s /usr/share/munin/plugins/mysql_queries /etc/munin/plugins/mysql_queries
ln -s /usr/share/munin/plugins/mysql_slowqueries /etc/munin/plugins/mysql_slowqueries
ln -s /usr/share/munin/plugins/mysql_threads /etc/munin/plugins/mysql_threads
vim /etc/munin/plugin-conf.d/munin-node

[mysql*]
env.mysqladmin /usr/bin/mysqladmin   # ←追記
env.mysqlopts -u root -pパスワード   # ←追記


再起動

/etc/rc.d/init.d/munin-node restart


Apache用のプラグインなんかもあってWEBサーバに良い感じ

Apacheのプラグインを入れる


いくつか見てみる


CPU usage


Memory usage


ロードアベレージ


apacheのプロセス


MySQLのクエリー数


色々実験中だから並があるけど、バッチを動かしてる時がやっぱ重いようだ



おわり