Skip to content

Instantly share code, notes, and snippets.

@zembutsu
Last active December 21, 2015 12:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zembutsu/6306556 to your computer and use it in GitHub Desktop.
Save zembutsu/6306556 to your computer and use it in GitHub Desktop.
Munin2 の CentOS 向けチュートリアル

Munin2 QuickTutorial

CentOS6 で、とにかく Munin を使い始めるための方法をまとめました。http://<ホスト名>/munin/ で対象サーバの上方を閲覧できるようにします。

事前準備

Munin を EPEL リポジトリで配付されているパッケージを用いてセットアップします。そのために、まずは EPEL リポジトリを有効化します。

# rpm -ivh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/i386/epel-release-6-8.noarch.rpm

Munin のセットアップ

yum 使って一括インストールします。

# yum -y install munin

必要なパッケージは、これでセットアップされます。

munin-node の起動

次にエージェント(munin-node)を起動します。

# service munin-node start

サーバブート時に自動起動するようにします。

# chkconfig --add munin-node
# chkconfing munin-node on

BASIC 認証設定

デフォルトの設定で、自動的に BASIC 認証が使えます。

# htpasswd -bc /etc/munin/munin-htpasswd admin munin

この例では ID: admin 、Password: munin としましたが、任意のものに置き換えて下さい。 BASIC 認証が有効になるように Apache の再起動を行います。

# service httpd restart

グラフ生成テスト

# sudo -u munin /usr/bin/munin-cron

通常は cron によって5分に1回 munin-cron を実行します。このタイミングで、データの収集、グラフの生成等を行います。一度コマンドを実行すると、cron の実行タイミングを待たずにグラフが生成されます。

あとはブラウザから http://<ホスト名>/munin/ にアクセスします。グラフに継続値が反映されるのは、更に次のタイミングで munin が cron によって実行される時です。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment