前提:
要监控的Nginx需要提前安装Agent代理
选择Nginx by zabbix agent模板
在配置上新增一条配置
Nginx 配置示例:
location = /basic_status {
stub_status;
allow <IP of your Zabbix server/proxy>;
deny all;
}
重启nginx服务
systemctl restart nginx
如果使用其他位置,请不要忘记更改 {$NGINX.STUB_STATUS.PATH} 宏。
访问http://localhost/basic_status 会出现页面:
Active connections: 291
server accepts handled requests
16630948 16630948 31070465
Reading: 6 Writing: 179 Waiting: 106
方案支持 https 和重定向。