1. 程式人生 > >check mk 監控 nginx

check mk 監控 nginx

location 編譯 list onf code 客戶端 nginx配置 localhost address

1、查看nginx是否編譯了status模塊:
nginx -V 2>&1 | grep -o with-http_stub_status_module

2、添加nginx的檢測腳本到被檢測客戶端:
cp nginx_status /usr/lib/check_mk_agent/plugins/

3、添加nginx配置:
vi /etc/nginx/conf.d/local.conf
添加:

server {
                listen       8065;
                server_name 127.0.0.1;
                location /nginx_status {
                stub_status on;
                access_log off;
                allow 127.0.0.1;
                deny all;
        }
        }

4、添加配置:
vi /etc/check_mk/nginx_status.cfg

servers = [
{
 ‘protocol‘ : ‘http‘,
 ‘address‘  : ‘localhost‘,
 ‘port‘     : 8065,
 ‘page‘     : ‘nginx_status‘,
},
]

4、reload並測試:
/etc/init.d/nginx force-reload
wget -qO - http://127.0.0.1:8065/nginx_status

check mk 監控 nginx