Top > Install Log > CentOS6 > Munin
AND OR

Muninの導入

システムの状態を監視するツールとして、 RDDtoolCactiが有名。

今回は「簡単にインストールできて、いろんな情報が取れる」と評判の、 Muninをインストールする。

Muninのインストール

EPELリポジトリを利用して、インストールする。依存関係でかなり多くのソフトウェアをインストールすることになる(はず)。

# yum --enablerepo=epel install munin munin-node

munin用のApacheの設定を一部変更する。

# vi /etc/httpd/conf.d/munin.conf

次の箇所をコメントアウトしておく。実際に運用するときには認証を設定するなり、アクセスできるホストを制限したほうがいい。

AuthUserFile /etc/munin/munin-htpasswd
AuthName "Munin"
AuthType Basic
require valid-user

とりあえずノードを起動するだけなら、次のように操作する。

# service httpd start   ←Apache(httpd)がまだ起動していない場合
# service httpd restart   ←Apache(httpd)が起動している場合
# service munin-node start
# chkconfig munin-node on

Muninへのアクセス

Muninでは、5分ごとに情報を更新する。

デフォルトでは、「http://<インストールしたサーバ>/munin」へアクセスすれば、 情報が得られる。

Muninの設定

Muninでは、どんな情報を収集するかは、「プラグイン」として管理されている。

  • インストール時に使用可能なプラグインは、/usr/share/munin/plugins/以下にある。
  • 実際に使用するプラグインは、/etc/munin/plugins/へシンボリックリンクが張られる。

したがって、収集したい情報を追加したい場合は、次のような手順になる。

  1. /usr/share/munin/plugins/に収集したい情報があるかどうか調べる
    • もしなければ追加するか、設定を変更する
  2. /etc/munin/plugins/に/usr/share/munin/plugins/の使用するプラグインへのシンボリックリンクを張る
    # ln -s /usr/share/munin/plugins/hogehoge /etc/munin/plugins/hogehoge

SATA HDDの温度をグラフにする

必要なコマンドをインストール。

# yum install smartmontools

あと、プラグインも設定。

# ln -s /usr/share/munin/plugins/hddtemp_smartctl /etc/munin/plugins

ただ、このままではIDEのHDDしか、温度を調べてくれない。 そこで、次のように設定ファイルを編集する。

# vi /etc/munin/plugin-conf.d/hddtemp_smartctl

編集内容は、たとえば次のような感じ。HDDが/dev/sdaと/dev/sdbの場合。

[hddtemp_smartctl]
user root
env.drives sda sdb     ←追加
env.args_sda -all -d scsi  ←追加(SCSIのディスクの場合)
env.args_sdb -all -d ata  ←追加(SATAのディスクの場合)

サービスを再起動しておく。

# serice munin-node restart

smartctrlでほかの情報も取る

HDDに関する情報をSMARTから取得する。

まず、プラグインのコピーをする。

# ln -s /usr/share/munin/plugins/smart_ /etc/munin/plugins/smart_sda

さらに、プラグインの設定ファイルを作成する。

# vi /etc/munin/plugin-conf.d/smart_

内容はこんな感じで。

[smart_*]
user root

[smart_sda]
env.smartargs -d scsi

参考URL


リロード   差分   ホーム 一覧 検索 最終更新 バックアップ リンク元   ヘルプ   最終更新のRSS
Last-modified: Wed, 19 Mar 2014 20:43:11 JST (3690d)