:::: MENU ::::

munin2.0.10をyumでインストール

epel のリポジトリを使えるように設定

# wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
# rpm -ivh epel-release-5-4.noarch.rpm
# vi /etc/yum.repos.d/epel.repo
enable=0

Host サーバ/Web サーバ向け

yum で munin と munin-node をインストール

# yum --enablerepo=epel install munin munin-node

Apache の設定

# cd /etc/httpd/conf.d/
# vi munin.conf
ScriptAlias /munin/cgi /var/www/cgi-bin
Alias /munin /var/www/munin

<directory /var/www/munin>
ExpiresActive On
ExpiresDefault M310

Options FollowSymLinks
AllowOverride All
Order Deny,Allow
Allow from All
</directory>
# vi ../conf/httpd.conf
ExtendedStatus On
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>

munin の設定

設定ファイルに追記

# cd /var/www/
# mv html/munin/ ./
# vi /etc/munin/munin.conf
dbdir   /var/lib/munin
htmldir /var/www/munin
logdir /var/log/munin
rundir  /var/run/munin
tmpldir /etc/munin/templates
cgiurl_graph /cgi-bin/munin-cgi-graph
# vi /etc/munin/plugin-conf.d/munin-node
[apache_*]
env.url   http://127.0.0.1:%d/server-status?auto
env.ports 80

サーバのグループ分けと、取りに行くサーバの IP を記載

# vi /etc/munin/munin-node.conf
[local;]
[local;web]
address 127.0.0.1
use_node_name yes
[local;db]
address 192.168.0.2
use_node_name yes

プラグインを追加

# ln -s /usr/share/munin/plugins/apache_accesses /etc/munin/plugins/apache_accesses
# ln -s /usr/share/munin/plugins/apache_processes /etc/munin/plugins/apache_processes
# ln -s /usr/share/munin/plugins/apache_volume /etc/munin/plugins/apache_volume

起動して確認

# /etc/init.d/munin-node start
# /usr/sbin/munin-run --servicedir /usr/share/munin/plugins apache_accesses autoconf
# chkconfig munin-node on

DB 向け

yum で munin-node をインストール

# yum --enablerepo=epel install munin-node

munin の設定

MySQL 用のプラグインを追加

# ln -s /usr/share/munin/plugins/mysql_bytes /etc/munin/plugins/mysql_bytes
# 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

設定ファイルに追記

# vi /etc/munin/plugin-conf.d/munin-node
[mysql*]
env.mysqlopts -u root -phogehoge
env.mysqladmin /usr/bin/mysqladmin

host サーバからアクセスできるように許可

# vi /etc/munin/munin-node.conf
allow ^127\.0\.0\.1$
allow ^192\.168\.0\.1$
allow ^::1$

起動して確認

# /etc/init.d/munin-node start
# /usr/sbin/munin-run --servicedir /usr/share/munin/plugins mysql_queries autoconf
# chkconfig munin-node on