Last active
August 29, 2015 14:16
-
-
Save kenzo0107/29582fe37b8d29bf4192 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rootユーザへ変更 | |
sudo su - | |
Password: (パスワード入力) | |
# munin, munin-node インストール | |
yum install --enablerepo=epel munin munin-node | |
# muninのhtpasswd設定 | |
htpasswd -c /etc/munin/munin-htpasswd (BASIC認証ID入力) | |
New password: (BASIC認証PW入力) | |
Re-type new password: (BASIC認証PW入力) | |
Adding password for user (BASIC認証IDが表示されます) | |
htpasswd: unable to update file /etc/munin/munin-htpasswd | |
# munin設定ファイル編集 - | |
vim /etc/munin/munin.conf | |
# 以下追記 | |
# ---start----- | |
contact.email.command mail -s "Munin ${var:group}::${var:host}" email@example.com | |
contact.email.max_messages 1 | |
contact.email.always_send warning critical | |
# ---end----- | |
# munin-node起動 | |
service munin-node start | |
# munin-nodeを起動リストに追加 | |
chkconfig munin-node on | |
# apache再起動 | |
service httpd restart | |
# http://(IPアドレス)/muninにアクセスし表示されることを確認してください。 | |
# 以上で | |
# MySQL用のplugin追加 | |
sudo ln -s /usr/share/munin/plugins/mysql_bytes /etc/munin/plugins/mysql_bytes | |
sudo ln -s /usr/share/munin/plugins/mysql_queries /etc/munin/plugins/mysql_queries | |
sudo ln -s /usr/share/munin/plugins/mysql_slowqueries /etc/munin/plugins/mysql_slowqueries | |
sudo ln -s /usr/share/munin/plugins/mysql_threads /etc/munin/plugins/mysql_threads | |
# munin-node設定ファイル編集 | |
sudo vi /etc/munin/plugin-conf.d/munin-node | |
# 以下追記 | |
[mysql*] | |
env.mysqladmin /usr/bin/mysqladmin | |
env.mysqlopts -u root -p<password> | |
# CGIが動作可能な様、ディレクトリの所属グループをapacheに変更 | |
# apacheのユーザー名を変更している場合には、そのapacheユーザーが所属するグループ | |
sudo chgrp apache /usr/share/munin/munin-graph | |
sudo chgrp apache /var/log/munin /var/log/munin/munin-graph.log | |
sudo chmod g+w /var/log/munin /var/log/munin/munin-graph.log | |
sudo chgrp -R apache /var/www/html/munin/ | |
sudo chmod -R g+w /var/www/html/munin/ | |
# ズーミンググラフが表示されない場合には、 | |
# apacheのエラーログを確認し「Permission denied」なら | |
# ディレクトリの権限や所有者、所属グループの確認を行います。 | |
# 「File does not exist: /var/www/html/munin/munin-cgi」のようなエラーは | |
# 上記のエイリアスに問題がないか、/var/www/html/munin/munin-cgiが存在するかなどを確認してみてください。 | |
# redis監視 | |
cd /usr/share/munin/plugins/ | |
wget https://raw.github.com/bpineau/redis-munin/master/redis_ | |
chmod +x redis_ | |
ln -s /usr/share/munin/plugins/redis_ /etc/munin/plugins/redis_127.0.0.1_6379 | |
# 上記wgetコマンドが正常に実行できないときは、ローカルPCに一度ダウンロードして | |
# /usr/share/munin/plugins/へアップする、で問題ないです。 | |
# munin-node再起動で設定反映 | |
service munin-node restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment