LoginSignup
1
2

More than 5 years have passed since last update.

centos7 munin nginx で監視

Posted at

muninで監視するのが良いらしい。
とりあえずパスワードとか無しで。

munin インストール


yum -y install munin --enablerepo=epel

コメントアウトを外す

vi /etc/munin/munin.conf

dbdir   /var/lib/munin
htmldir /var/www/html/munin
logdir /var/log/munin
rundir  /var/run/munin

111.22.33.55/munin で見れるように

今ある設定に追記


server {

    listen 80;

    location /munin {
        alias /var/www/html/munin/;
    }

    location /nginx_status {
        stub_status on;
        access_log off;
    }

}


再起動


sudo systemctl restart nginx.service
systemctl start munin-node.service
systemctl enable munin-node.service

ログを取得する関係上、
5分後に見れるらしいが、まちきれないので

sudo -u munin munin-cron

OK 111.22.33.55/munin で見れるようになっていることを確認

つづいてさらに nginxを設定

必要なファイルはすでに入っているのでシンボリックリンクを貼るだけ。


cd /usr/share/munin/plugins
ln -s /usr/share/munin/plugins/nginx_status /etc/munin/plugins/nginx_status
 ln -s /usr/share/munin/plugins/nginx_request /etc/munin/plugins/nginx_request

再起動


sudo systemctl restart nginx.service
systemctl restart munin-node.service

OK nginx の項目が増えていれば

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2