みなさん、おはこんばんちわ。サーバを追加しては muninに(*´Д`)/ヽァ/ヽァしてるしょっさんです、毎度おはようございます。挨拶は何度でもします。
さて、Debian squeeze で munin 2.0.9 が poolに公開されていたので、特に現行に問題も文句もありませんでしたが更新してみました。ら、変なところではまったので記して残しておきます。
client node 側の更新
こちらははまりようがないはずです。何も起きませんでしたから。多分。
もし、”munin-node.conf に差異があるよ?” と聞かれることがあれば、「N」(現行の設定を残す)を選択しておいてください。
まず、ダウンロードしましょう。次のコマンドを入力ください。順番がありますので次の通りにどうぞ。 [I]“/tmp” で作業することにしました。
cd /tmp
wget http://ftp.jp.debian.org/debian/pool/main/m/munin/munin-common_2.0.9-2_all.deb
wget http://ftp.jp.debian.org/debian/pool/main/m/munin/munin-node_2.0.9-2_all.deb
wget http://ftp.jp.debian.org/debian/pool/main/m/munin/munin-plugins-core_2.0.9-2_all.deb
次にパッケージをインストールしましょう。dpkgコマンドですよ。
sudo dpkg -i munin-common_2.0.9-2_all.deb
sudo dpkg -i munin-plugins-core_2.0.9-2_all.deb
sudo dpkg -i munin-node_2.0.9-2_all.deb
以上ですヽ(´ー`)ノお茶の子さいさいですね。
server 側の更新
始めに一つ問います。/etc/munin/munin.confで、次の項目を有効にしている人は気をつけてください。
graph_strategy cgi
グラフ表示をcronではなく、cgiを使っている人用の事前作業
munin 2.0.9 から、apache の fastcgi ではなく、”fcgid” を使うように変更になっています。”fcgid“が enableになくても動くようですが、折角なので新しいモジュールを有効にしましょう。
次のコマンドで、足りないモジュールの追加と、apache のモジュールを有効にしましょう。
sudo apt-get install libapache2-mod-fcgid
sudo a2enmod rewrite
sudo a2enmod fcgid
詳しくはこちら。
“CgiHowto2 – Munin”
※1 今回の手順の流れでいけば、正確には「sudo a2enmod rewrite」は不要です。
※2 html_strategy cgiを有効化することができるようですが、以下の手順どおりにやってもうまくいきません。apache.conf の書き換えが必要みたいですが、squeeze 用の 2.0.9-2-munin.confを見ると、まだ bugがあるようで勧められてません。今のところはムリしないが吉かも知れません。今度、うまくいったらご報告します。
munin 2.0.9 のダウンロード
では、次のコマンドで、一旦 /tmp 配下へダウンロードしましょう。
cd /tmp
wget http://ftp.jp.debian.org/debian/pool/main/m/munin/munin_2.0.9-2_all.deb
wget http://ftp.jp.debian.org/debian/pool/main/m/munin/munin-doc_2.0.9-2_all.deb
wget http://ftp.jp.debian.org/debian/pool/main/m/munin/munin-common_2.0.9-2_all.deb
wget http://ftp.jp.debian.org/debian/pool/main/m/munin/munin-node_2.0.9-2_all.deb
wget http://ftp.jp.debian.org/debian/pool/main/m/munin/munin-plugins-core_2.0.9-2_all.deb
munin 2.0.9 のインストール
さて、インストールします。気をつけてください。まず、順番は次のとおりです。 [II]2.0.6が入っていれば、sudo dpkg -i munin-*.deb でも平気みたい
sudo dpkg -i munin-common_2.0.9-2_all.deb
sudo dpkg -i munin-plugins-core_2.0.9-2_all.deb
sudo dpkg -i munin_2.0.9-2_all.deb munin-doc_2.0.9-2_all.deb munin-node_2.0.9-2_all.deb
次、「munin.conf」と「apache.conf」の書き換えをしても良いか? というのが出てくるかも知れません。次のようにしてください。
- munin.conf → 「N」 現行の設定を維持
- apache.conf → 「Y」 新しい設定ファイルへ更新
apache.confに手を入れすぎていて、どうしようもない人は、下の方にある差分を見ながら、fast.cgi → fcgid部分をうまく変更してください。
設定変更すると言っても “Allow from localhost 127.0.0.0/8 ::1” を接続するクライアントの分を追加するなりしているだけの人であれば、apache.confを新しい設定ファイルへ移行して、”Allow from“を変更するだけの方が確実でしょう。
設定変更していなかった方、おめでとうございます。ここで終了です。
変更の必要になるファイルは /etc/munin/apache.conf にあります。
もし、localhost 以外から munin の webグラフへアクセスする人は、apache.conf の Allow from 〜 へ、アクセスするクライアントのアドレスを追加してください。大事なことだから二度言いました。もう一つオマケに言うと、apache.conf を修正したら、apache を再起動しましょう。
munin 2.0.6 と 2.0.9 の “apache.conf” の違い
ちなみに、2.0.6 と 2.0.9 で何がちがうかというと、fastcgi ではなく、先ほど有効にした fcgid を利用するようになっています。比較用に、各々の「/etc/munin/apache.conf」を載せておきますね。
diff してみた結果
diff apache.conf.munin-2.0.6-1 apache.conf.munin-2.0.9-2
70,72c71,76
<
< SetHandler fastcgi-script
<
---
>
> SetHandler fcgid-script
>
>
> SetHandler cgi-script
>
83,85c88,93
<
< SetHandler fastcgi-script
<
---
>
> SetHandler fcgid-script
>
>
> SetHandler cgi-script
>
munin 2.0.6
# Enable this for template generation
Alias /munin /var/cache/munin/www
# Enable this for cgi-based templates
#Alias /munin-cgi/static /var/cache/munin/www/static
#ScriptAlias /munin-cgi /usr/lib/munin/cgi/munin-cgi-html
#
# Order allow,deny
# Allow from localhost 127.0.0.0/8 ::1
# AuthUserFile /etc/munin/munin-htpasswd
# AuthName "Munin"
# AuthType Basic
# require valid-user
#
Order allow,deny
Allow from localhost 127.0.0.0/8 ::1
Options None
# This file can be used as a .htaccess file, or a part of your apache
# config file.
#
# For the .htaccess file option to work the munin www directory
# (/var/cache/munin/www) must have "AllowOverride all" or something
# close to that set.
#
# AuthUserFile /etc/munin/munin-htpasswd
# AuthName "Munin"
# AuthType Basic
# require valid-user
# This next part requires mod_expires to be enabled.
#
# Set the default expiration time for files to 5 minutes 10 seconds from
# their creation (modification) time. There are probably new files by
# that time.
#
ExpiresActive On
ExpiresDefault M310
# Enables fastcgi for munin-cgi-html if present
#
#
# SetHandler fastcgi-script
#
#
#
# SetHandler None
#
# Enables fastcgi for munin-cgi-graph if present
ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
Order allow,deny
Allow from localhost 127.0.0.0/8 ::1
# AuthUserFile /etc/munin/munin-htpasswd
# AuthName "Munin"
# AuthType Basic
# require valid-user
SetHandler fastcgi-script
ScriptAlias /munin-cgi/munin-cgi-html /usr/lib/munin/cgi/munin-cgi-html
Order allow,deny
Allow from localhost 127.0.0.0/8 ::1
# AuthUserFile /etc/munin/munin-htpasswd
# AuthName "Munin"
# AuthType Basic
# require valid-user
SetHandler fastcgi-script
munin 2.0.9
# Enable this for template generation
Alias /munin /var/cache/munin/www
# Enable this for cgi-based templates
#Alias /munin-cgi/static /var/cache/munin/www/static
#ScriptAlias /munin-cgi /usr/lib/munin/cgi/munin-cgi-html
#
# Order allow,deny
# Allow from localhost 127.0.0.0/8 ::1
# AuthUserFile /etc/munin/munin-htpasswd
# AuthName "Munin"
# AuthType Basic
# require valid-user
#
Order allow,deny
Allow from localhost 127.0.0.0/8 ::1
Options None
# This file can be used as a .htaccess file, or a part of your apache
# config file.
#
# For the .htaccess file option to work the munin www directory
# (/var/cache/munin/www) must have "AllowOverride all" or something
# close to that set.
#
# AuthUserFile /etc/munin/munin-htpasswd
# AuthName "Munin"
# AuthType Basic
# require valid-user
# This next part requires mod_expires to be enabled.
#
# Set the default expiration time for files to 5 minutes 10 seconds from
# their creation (modification) time. There are probably new files by
# that time.
#
ExpiresActive On
ExpiresDefault M310
# Enables fastcgi for munin-cgi-html if present
#
#
# SetHandler fastcgi-script
#
#
#
# SetHandler None
#
# Enables fastcgi for munin-cgi-graph if present
ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
Order allow,deny
Allow from localhost 127.0.0.0/8 ::1
# AuthUserFile /etc/munin/munin-htpasswd
# AuthName "Munin"
# AuthType Basic
# require valid-user
SetHandler fcgid-script
SetHandler cgi-script
ScriptAlias /munin-cgi/munin-cgi-html /usr/lib/munin/cgi/munin-cgi-html
Order allow,deny
Allow from localhost 127.0.0.0/8 ::1
# AuthUserFile /etc/munin/munin-htpasswd
# AuthName "Munin"
# AuthType Basic
# require valid-user
SetHandler fcgid-script
SetHandler cgi-script
