1 查看 nginx 是否编译了 status 模块:
nginx - V 2 & gt; & 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,
- },
- ]
4reload 并测试:
- /etc/init.d / nginx force - reload wget - qO - http: //127.0.0.1:8065/nginx_status
来源: http://www.bubuko.com/infodetail-2491678.html