Nginx zabbix 的监控
Nginx zabbix 的监控
Nginx 配置
- Nginx 必须包含:http_stub_status_module 模块
./nginx -V |grep http_stub_status_module
- Nginx 配置 (/911dc1aa4cb0af843f24448323752a29 用于自动发现)
server { listen 9002; location = /911dc1aa4cb0af843f24448323752a29 { return 200 "nginx_stat_for_zabbix"; } location = /basic_status { stub_status; } }
zabbix 配置
-
/usr/local/zabbix327/bin 新增 lld_nginx.py,并增加可执行权限
-
新增 UserParameter
UserParameter=nginx.server.discovery[],/usr/local/zabbix327/bin/lld_nginx.py -t $1 -k "$2"
UserParameter=nginx.server.stat[],/usr/local/zabbix327/bin/lld_nginx.py -t $1 -d $2 -p $3 -
导入模板