标签:lis str init log res usr 配置 force code
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
标签:lis str init log res usr 配置 force code
原文地址:http://blog.51cto.com/backkom/2070066