nginx端相关操作
在nginx.conf中添加如下内容
#vi nginx.conf
...
location /nginx-status {
stub_status on;
access_log
off;
allow
192.168.233.0/24;
deny
all;
}
...
检查修改后的配置文件
# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
重新加载
# nginx -s reload
浏览器访问
zabbix端相关操作
添加监控项
# pwd
/etc/zabbix/zabbix_agentd.d
# vi nginx.conf
UserParameter=nginx.active,curl -s
"http://192.168.233.131:8080/nginx-status" | grep 'Active' | awk '{print $NF}'
重启zabbix agent
# systemctl restart zabbix-agent
安装zabbix-get
# yum install zabbix-get -y
验证监控
# zabbix_get -s 192.168.233.131 -p 10050 -k "nginx.active"
1
添加item
添加graphs
压测一下
ab -c 20 -n 10000000 http://192.168.233.131:8080/
screen
最后
以上就是清新西牛最近收集整理的关于zabbix3.2 添加nginx监控(连接数)的全部内容,更多相关zabbix3.2内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复