珀耳塞福建 发表于 2018-11-12 06:37:17

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


页: [1]
查看完整版本: check mk 监控 nginx