RIGHT:[[フリーソフトウェアのコンパイル]]

*パッケージ追加の準備(サーバ側,ノード側) [#bf4be6be]
http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/i386/repoview/epel-release.html
より EPEL リポジトリパッケージを取得.

 % sudo rpm -ivh src/epel-release-6-8.noarch.rpm
 % sudo vi /etc/yum.repos.d/epel.repo
を編集し,最初の
 enabled=1
を
 enabled=0
としておく.

----
*サーバ側 [#gfe59b9d]
**パッケージ追加 [#pb311824]
 % sudo yum --enablerepo=epel install munin
山の用にたくさんのパッケージが導入される.

**/etc/httpd/conf/httpd.conf を編集 [#n0634a1b]

 LoadModule auth_basic_module modules/mod_auth_basic.so
 LoadModule authn_file_module modules/mod_authn_file.so
 LoadModule authz_host_module modules/mod_authz_host.so
 LoadModule authz_user_module modules/mod_authz_user.so

**アクセスユーザ,パスワード設定 [#n8ecc33e]
 #  htpasswd  /etc/munin/munin-htpasswd munin
 New password:
 Re-type new password:
 Adding password for user munin

**Apache 再起動 [#q9137092]
 # /etc/init.d/httpd configtest
 # /etc/init.d/httpd restart

**ブラウザでアクセス [#ie2159ad]
 http://X.X.X.X/munin

**監視ノード追加 [#eecaeabc]
/etc/munin/munin.conf を編集

 [グループ名;]
  node_order node01 node02 node03 ...
 [グループ名;ノード名]
  address 対象アドレス
  use_nodename yes

**過去データを丸めずに表示 [#t54a2af8]
/etc/munin/munin.conf の監視ノードの設定をしているブロックより前
(グローバルの設定)に以下を書いておく.
 graph_data_size huge

cron で動いているので,再起動の必要なし.

----
*ノード側 [#nc6a0c88]
**パッケージ追加 [#b904feaf]
 % sudo yum --enablerepo=epel install munin-node

ノードをインストールしたマシンでは,
 # chkconfig --add munin-node
 # chkconfig munin-node on
 # /etc/init.d/munin-node start

**/etc/munin/munin-node.conf を編集 [#x636fc8d]
  allow ^192\.168\.1\.1$    <---サーバのドレス

**iptables [#o61d6584]
/etc/sysconfig/iptables
 -A INPUT -m state --state NEW -m tcp -p tcp --dport 4949 -j ACCEPT

**ノード側で監視する項目の調整 [#p7ed7841]
/etc/munin/plugins
にある不要なシンボリックリンクを削除する.
 # cd /etc/munin/plugins
 # rm postfix_mail*
 # rm selinux_avcstat
 # rm fw_*
 # rm ntp*
 # /etc/init.d/munin-node restart


**Apache の監視(Web サーバにて) [#u04b0a89]
/etc/httpd/conf/httpd.conf

 # LoadModule auth_basic_module modules/mod_auth_basic.so
 # LoadModule authn_file_module modules/mod_authn_file.so
 LoadModule authz_host_module modules/mod_authz_host.so
 LoadModule authz_user_module modules/mod_authz_user.so
 LoadModule status_module modules/mod_status.so
 ExtendedStatus On
 <Location /server-status>
     SetHandler server-status
     Order deny,allow
     Deny from all
     Allow from 127.0.0.1
 </Location>

 # cd /etc/munin/plugins
 # ln -s /usr/share/munin/plugins/apache_accesses .
 # ln -s /usr/share/munin/plugins/apache_processes .
 # ln -s /usr/share/munin/plugins/apache_volume .
 # /etc/init.d/munin-node restart

**MySQL 監視(DB サーバにて) [#af6af5ba]
MySQL ユーザ追加
 # mysql -u root -p
 mysql> CREATE DATABASE munin;
 mysql> GRANT SELECT ON munin.* TO munin@localhost IDENTIFIED BY 'password';
 mysql> FLUSH PRIVILEGES;

 # vi /etc/munin/plugin-conf.d/munin-node
以下の 2行を追加
 [mysql*]
 env.mysqlopts -u munin --password=password

設定をテスト
 # cd /etc/munin/plugins
 # ln -s /usr/share/munin/plugins/mysql_bytes .
 # ln -s /usr/share/munin/plugins/mysql_queries .
 # ln -s /usr/share/munin/plugins/mysql_slowqueries .
 # ln -s /usr/share/munin/plugins/mysql_threads .
 
 # cd /etc/munin/plugins
 # /usr/sbin/munin-run mysql_bytes
 recv.value 22650065
 sent.value 104515744
 # /usr/sbin/munin-run mysql_queries
 delete.value 741
 insert.value 1317
 replace.value 0
 select.value 60604
 update.value 2829
 cache_hits.value 0
 # /usr/sbin/munin-run mysql_slowqueries
 queries.value 0
 # /usr/sbin/munin-run mysql_threads
 threads.value 1
 
 # /etc/init.d/munin-node restart

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS