フリーソフトウェアのコンパイル

パッケージ追加の準備(サーバ側,ノード側)

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

としておく.


サーバ側

パッケージ追加

% sudo yum --enablerepo=epel install munin

山の用にたくさんのパッケージが導入される.

/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

アクセスユーザ,パスワード設定

#  htpasswd  /etc/munin/munin-htpasswd munin
New password:
Re-type new password:
Adding password for user munin

Apache 再起動

# /etc/init.d/httpd configtest
# /etc/init.d/httpd restart

ブラウザでアクセス

http://X.X.X.X/munin

監視ノード追加

/etc/munin/munin.conf を編集

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

過去データを丸めずに表示

/etc/munin/munin.conf の監視ノードの設定をしているブロックより前 (グローバルの設定)に以下を書いておく.

graph_data_size huge

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


ノード側

パッケージ追加

% 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 を編集

 allow ^192\.168\.1\.1$    <---サーバのドレス

iptables

/etc/sysconfig/iptables

-A INPUT -m state --state NEW -m tcp -p tcp --dport 4949 -j ACCEPT

ノード側で監視する項目の調整

/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 サーバにて)

/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 サーバにて)

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
Last-modified: 2013-09-02 (月) 13:43:08