:::: MENU ::::

munin1.4.2をCentOS5.2にrpmでインストールする

インストール手順

yum編

CentOS5にMuninをインストール (Re::Monologue)

rpm編

munin-1.2.6-4.el5.noarch.rpm
munin-node-1.2.6-4.el5.noarch.rpm
perl-Compress-Raw-Zlib-2.015-1.el5.rf.i386.rpm
perl-Compress-Zlib-2.015-1.el5.rf.noarch.rpm
perl-Crypt-DES-2.05-3.2.el5.rf.i386.rpm
perl-Date-Manip-5.54-2.el5.rf.noarch.rpm
perl-Digest-HMAC-1.01-15.noarch.rpm
perl-HTML-Parser-3.59-1.el5.rf.i386.rpm
perl-HTML-Tagset-3.20-1.el5.rf.noarch.rpm
perl-HTML-Template-2.9-1.el5.rf.noarch.rpm
perl-IO-Compress-Base-2.015-1.el5.rf.noarch.rpm
perl-IO-Compress-Zlib-2.015-1.el5.rf.noarch.rpm
perl-Net-SNMP-5.2.0-1.2.el5.rf.noarch.rpm
perl-Net-Server-0.97-1.el5.rf.noarch.rpm
perl-Socket6-0.20-1.el5.rf.i386.rpm
perl-libwww-perl-5.805-1.1.1.noarch.rpm
perl-rrdtool-1.2.30-1.el5.rf.i386.rpm
rrdtool-1.2.30-1.el5.rf.i386.rpm
以上を入れた。

ログ

# rpm -ivh perl-Socket6-0.20-1.el5.rf.i386.rpm
# rpm -ivh perl-Date-Manip-5.54-2.el5.rf.noarch.rpm
# rpm -ivh perl-Digest-SHA1-2.11-1.2.1.i386.rpm
# rpm -ivh hdparm-6.6-2.i386.rpm
# rpm -ivh perl-Compress-Raw-Zlib-2.015-1.el5.rf.i386.rpm
# rpm -ivh perl-Crypt-DES-2.05-3.2.el5.rf.i386.rpm
# rpm -ivh perl-Digest-HMAC-1.01-15.noarch.rpm
# rpm -ivh perl-HTML-Tagset-3.20-1.el5.rf.noarch.rpm
# rpm -ivh perl-HTML-Parser-3.59-1.el5.rf.i386.rpm
# rpm -ivh perl-HTML-Template-2.9-1.el5.rf.noarch.rpm
# rpm -ivh perl-IO-Compress-Base-2.015-1.el5.rf.noarch.rpm
# rpm -ivh perl-IO-Compress-Zlib-2.015-1.el5.rf.noarch.rpm
# rpm -ivh perl-Net-SNMP-5.2.0-1.2.el5.rf.noarch.rpm
# rpm -ivh perl-Net-Server-0.97-1.el5.rf.noarch.rpm
# rpm -ivh perl-Compress-Zlib-2.015-1.el5.rf.noarch.rpm
# rpm -ivh perl-libwww-perl-5.805-1.1.1.noarch.rpm
# rpm -ivh rrdtool-1.2.30-1.el5.rf.i386.rpm perl-rrdtool-1.2.30-1.el5.rf.i386.rpm
# rpm -ivh munin-1.2.6-4.el5.noarch.rpm munin-node-1.2.6-4.el5.noarch.rpm
# cd /var/www/
# mkdir munin
# chown -R munin:munin munin/
# vi /etc/munin/munin.conf
ScriptAlias /munin/cgi/ /var/www/munin/cgi/
Alias /munin/ /var/www/munin/

# 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
# vi /etc/munin/plugin-conf.d/munin-node
[mysql*]
env.mysqladmin /usr/bin/mysqladmin

# 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
# vi /etc/httpd/conf/httpd.conf
LoadModule status_module modules/mod_status.so
ExtendedStatus On

SetHandler server-status
Order Deny,Allow
Deny from all
Allow from localhost

# /etc/init.d/httpd restart
httpd を停止中:                                            [  OK  ]
httpd を起動中:                                            [  OK  ]
# /etc/init.d/munin-node start
Starting Munin Node:                                       [  OK  ]
# chkconfig munin-node on

RPM入れるときの注意点

  • perl-rrdtoolとrrdtoolだけは一緒に入れなければいけない
 # rpm -ivh rrdtool-1.2.30-1.el5.rf.i386.rpm
警告: rrdtool-1.2.30-1.el5.rf.i386.rpm: ヘッダ V3 DSA signature: NOKEY, key ID 6b8d79e6
エラー: 依存性の欠如:
perl(RRDp) は rrdtool-1.2.30-1.el5.rf.i386 に必要とされています
perl(RRDs) は rrdtool-1.2.30-1.el5.rf.i386 に必要とされています
# rpm -ivh perl-rrdtool-1.2.30-1.el5.rf.i386.rpm
警告: perl-rrdtool-1.2.30-1.el5.rf.i386.rpm: ヘッダ V3 DSA signature: NOKEY, key ID 6b8d79e6
エラー: 依存性の欠如:
librrd.so.2 は perl-rrdtool-1.2.30-1.el5.rf.i386 に必要とされています
rrdtool = 1.2.30 は perl-rrdtool-1.2.30-1.el5.rf.i386 に必要とされています
# rpm -ivh rrdtool-1.2.30-1.el5.rf.i386.rpm perl-rrdtool-1.2.30-1.el5.rf.i386.rpm
警告: rrdtool-1.2.30-1.el5.rf.i386.rpm: ヘッダ V3 DSA signature: NOKEY, key ID 6b8d79e6
準備中...                ########################################### [100%]
1:perl-rrdtool           ########################################### [ 50%]
2:rrdtool                ########################################### [100%]

munin,munin-node入れる場合(ホストってことね)

 # cd /service/data0/package/src/munin/
# yum install perl-DateManip perl-Digest-HMAC perl-Digest-SHA1 perl-libwww-perl hdparm
# rpm -ivh munin-common-1.4.2-0.rpl1.el5.noarch.rpm
# rpm -ivh perl-HTML-Template-2.9-3.el5.pp.noarch.rpm perl-Log-Log4perl-1.20-1.el5.pp.noarch.rpm perl-Net-SNMP-5.2.0-1.el5.kb.noarch.rpm perl-Net-Server-0.97-3.el5.pp.noarch.rpm perl-Crypt-DES-2.05-4.el5.kb.i386.rpm
# rpm -ivh rrdtool-1.2.19-1.el5.kb.i386.rpm rrdtool-perl-1.2.19-1.el5.kb.i386.rpm
# rpm -ivh munin-1.4.2-0.rpl1.el5.noarch.rpm munin-node-1.4.2-0.rpl1.el5.noarch.rpm
# mv /var/www/html/munin/ /var/www/
# 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
[mst;]
[mst;msthost1]
address 127.0.0.1
use_node_name yes
[mst;msthost2]
address 127.0.0.2
use_node_name yes
# vi /etc/munin/plugin-conf.d/munin-node
[apache*]
env.ports 8080
# vi /usr/local/apache/conf/extra/munin.conf
ScriptAlias /munin/cgi/ /var/www/munin/cgi/
Alias /munin/ /var/www/munin/
# vi /usr/local/apache/conf/httpd.conf
Options FollowSymLinks -Indexes
AllowOverride All
# vi /etc/httpd/conf/httpd.conf
LoadModule status_module modules/mod_status.so
ExtendedStatus On

SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1
# /usr/local/apache/bin/apachectl restart
# cd /var/www/munin/
# vi .htaccess
AuthUserFile /var/www/.htpasswd_munin
AuthName "Munin"
AuthType Basic
require valid-user
ExpiresActive On
ExpiresDefault M310
# htpasswd -c /var/www/.htpasswd_munin munin
# chown -R apache:apache .htpasswd_munin
# /etc/init.d/munin-node start
# chkconfig munin-node on

munin-nodeだけ入れる場合(ex:MySQLが入っているDBサーバ)

# cd /usr/local/src/
# yum install perl-Digest-HMAC perl-Digest-SHA1 perl-libwww-perl hdparm
# rpm -ivh munin-common-1.4.2-0.rpl1.el5.noarch.rpm
# rpm -ivh perl-Net-SNMP-5.2.0-1.el5.kb.noarch.rpm perl-Net-Server-0.97-3.el5.pp.noarch.rpm perl-Crypt-DES-2.05-4.el5.kb.x86_64.rpm
# rpm -ivh munin-node-1.4.2-0.rpl1.el5.noarch.rpm
# vi /etc/munin/munin-node.conf
allow ^127.0.0.1$
# vi /etc/munin/plugin-conf.d/munin-node
[mysql*]
env.mysqlopts -u root
env.mysqladmin /usr/bin/mysqladmin
# 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
# /etc/init.d/munin-node start
# chkconfig munin-node on
# /usr/sbin/munin-run --servicedir /usr/share/munin/plugins mysql_queries autoconf

グラフが表示されなくて困ったら

これでもグラフの空すら表示されない場合は、 localhostで読んでいるのでなければ、 muninのデータを投げる方のサーバのport4949が、開いてない可能性が高い。

MySQLとApacheのグラフを表示させる

アラートメールを送信させる

プラグインを探したい