科学の箱

科学・IT・登山の話題

IT

muninによるApacheの監視

投稿日:

MuninでローカルのApacheを監視する方法

この設定はすべてmunin-node(監視対象サーバー)での設定となる。ローカルのApacheを監視する場合にはmuninサーバーであるし、リモートならば、Apacheがインストールされているサーバーでの設定となる。

リモートサーバーをmunin masterで監視する設定についてはmunin.confを参照する。

プラグインを有効にする

Muninでアプリケーションを監視するときにはプラグインを利用する。Muninで提供されているプラグインはすべて/etc/munin/plugins以下にある。初期ではすべてのpluginが読み込まれるのではなく、/usr/share/munin/plugins以下にリンクがあるプラグインのみが読み込まれる。

Apacheにおけるプラグインはアクセス数、プロセス数、ボリュームが提供されているのでこれらのプラグインを有効にする。

以下の3つのシンボリックリンクを作成しMuninのApacheプラグインを利用できるようにする。

ln -s /usr/share/munin/plugins/apache_accesses /etc/munin/plugins/
ln -s /usr/share/munin/plugins/apache_processes /etc/munin/plugins/
ln -s /usr/share/munin/plugins/apache_volume /etc/munin/plugins/

httpd.confの修正

muninではApacheの状態監視にstatus_moduleを利用しているのでモジュールを読み込む。

LoadModule status_module modules/mod_status.so

ステータスを取得できるパスを設定する。下記で/server-statusを開くとステータスを取得できる。

<Location /server-status>
  AddDefaultCharset EUC-JP
  SetHandler server-status
  Order deny,allow
  Deny from all
  Allow   from 127.0.0.1
</Location>

拡張ステータスを取得するためにExtendedStatusを有効にする

ExtendedStatus On

変更した設定を有効にするためにhttpdを再起動する

/etc/init.d/httpd restart

ステータスが取れているかを確認する。

munin-run apache_accesses
accesses80.value 0

結果でaccesses80.valueで0と戻れば正しい。

wget http://127.0.0.1/server-status

server-statusにアクセスして状態が取れるかを確認する。

munin-nodeを再起動する

/etc/init.d/munin-node restart

munin.conf

リモートサーバーを監視する場合にはmunin master上にmunin.confにリモートサーバーを追加する。

[remotehost]
    address 192.168.1.2
    use_node_name yes

メタ情報

inarticle



メタ情報

inarticle



-IT
-

執筆者:


comment

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

関連記事

no image

PGP WDE Single Sign Onのトラブルシューティング

外出時に持ち運ぶことが多いラップトップは盗難・紛失時に情報漏洩の危険性がある。デスクトップのローカルHDDに保管されたデータは物理的にアクセスをしなければ、データを取得することはできない。またクラウド …

no image

Smokepingのセットアップ

Smokepingをセットアップする手順をまとめてみる。 必要なツールのインストール RRDTool SmokepingはRRDTool利用してログの収集とグラフを作成する。RRDToolはバージョン …

no image

git rmを取り消す方法

git rmで間違えて複数のファイルを消去してしまった時の対応方法 git reset HEAD . git checkout . Related posts:dhcp relayCascade Pr …

no image

Cisco LAP Troubleshooting.

http://www.cisco.com/en/US/products/ps6366/products_tech_note09186a00808f8599.shtml http://ry.tl/lap …

no image

zabbixインストールメモ

Zabbixをyum経由でCentOS6にインストールする su -c ‘rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel …

2014年2月
« 1月   3月 »
 12
3456789
10111213141516
17181920212223
2425262728  

side bar top



アーカイブ

カテゴリー