Ubuntu で Nginx のステータスを Munin でモニタリング
さくら VPS の Ubuntu 12.04 LTS を入れたホストで Munin による Nginx の監視を始めたので設定方法をメモしておく。 Node サービスのみセットアップ。 $ sudo apt-get install munin-node Nginx - stub_status 設定 Nginx には指定したパスを HTTP 叩くと自身の状況をレポートしてくれる HttpStubStatusModule がある。これは Ubuntu 12.04 で apt-get install nginx すると標準で付いている。 stub_status ディレクティブは、 nginx.conf 等のどこかに /nginx_status パスで stub_status が返るように設定する。サーバ内からのアクセスだけ許可するようにも設定しておく。 server { listen 80; server_name localhost; location /nginx_status { stub_status on; access_log off; allow 127.0.0.1; deny all; } } 設定したらリロードして試しに叩いて確認しておく。 $ sudo /etc/init.d/nginx reload $ wget -q -O - http://localhost/nginx_status Active connections: 1 server accepts handled requests 2214 2214 5846 Reading: 0 Writing: 1 Waiting: 0 Munin の Nginx プラグインを設定 標準で入っている nginx_request と nginx_status を設定しました。 plugins ディレクトリにプラグインスクリプトのシンボリックリンクを張ります。 ...