check mk 监控 nginx

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

转载于:https://blog.51cto.com/backkom/2070066

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值