文件名称:nginx zabbix监控模板
文件大小:4KB
文件格式:RAR
更新时间:2018-06-23 12:00:09
nginx
(1)原理 基于nginx提供的状态信息页面解析 基于登陆状态日志解析 (2)部署配置(客户端) 1)配置nginx 在对应server中添加状态信息页面location,启动状态信息服务 location /server-status { stub_status on; allow 127.0.0.1; deny all; access_log off; } 测试示例:http://127.0.0.1/server-status Active connections: 1 server accepts handled requests 924735 924735 925608 Reading: 0 Writing: 1 Waiting: 0 2)配置/usr/local/zabbix/etc/zabbix_agentd.conf 添加以下自定义键值: UserParameter=active,/usr/local/zabbix/script/nginx_status.sh active UserParameter=reading,/usr/local/zabbix/script/nginx_status.sh reading UserParameter=writing,/usr/local/zabbix/script/nginx_status.sh writing UserParameter=waiting,/usr/local/zabbix/script/nginx_status.sh waiting UserParameter=accepts,/usr/local/zabbix/script/nginx_status.sh accepts UserParameter=handled,/usr/local/zabbix/script/nginx_status.sh handled UserParameter=requests,/usr/local/zabbix/script/nginx_status.sh requests UserParameter=rps,/usr/local/zabbix/script/nginx_rps.py UserParameter=res_code[*],/usr/local/zabbix/script/nginx_logs.py $1
【文件预览】:
nginx_template1
----zbx_export_templates.xml(42KB)
----script()
--------nginx_rps.py(1001B)
--------nginx_log_stat2(6B)
--------nginx_status.sh(1KB)
--------nginx_log_stat(1B)
--------nginx_logs.py(2KB)