TITLE:Muninの導入 *Muninの導入 [#ib8ceace] システムの状態を監視するツールとして、 [[RDDtool:http://oss.oetiker.ch/rrdtool/]]や[[Cacti:http://www.cacti.net/]]が有名。 今回は「簡単にインストールできて、いろんな情報が取れる」と評判の、 [[Munin:http://munin.projects.linpro.no/]]をインストールする。 **Muninのインストール [#yf45412c] 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へのアクセス [#o68c14bf] Muninでは、5分ごとに情報を更新する。 デフォルトでは、「http://<インストールしたサーバ>/munin」へアクセスすれば、 情報が得られる。 **Muninの設定 [#zb372062] Muninでは、どんな情報を収集するかは、「プラグイン」として管理されている。 -インストール時に使用可能なプラグインは、/usr/share/munin/plugins/以下にある。 -実際に使用するプラグインは、/etc/munin/plugins/へシンボリックリンクが張られる。 したがって、収集したい情報を追加したい場合は、次のような手順になる。 +/usr/share/munin/plugins/に収集したい情報があるかどうか調べる --もしなければ追加するか、設定を変更する +/etc/munin/plugins/に/usr/share/munin/plugins/の使用するプラグインへのシンボリックリンクを張る # ln -s /usr/share/munin/plugins/hogehoge /etc/munin/plugins/hogehoge ***SATA HDDの温度をグラフにする [#v2e15cd6] 必要なコマンドをインストール。 # 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でほかの情報も取る [#qcf23e56] 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 [#d628ffe8] -http://easyramble.com/install-and-setup-munin.html -http://inaz2.hatenablog.com/entry/2013/08/12/025007 -http://d.hatena.ne.jp/over80/20080701/1214926377 |