开启status:
[root@localhost conf]# vim nginx.conf location / { root html; index index.html index.htm; } location /status { stub_status; } [root@localhost conf]# nginx -s reload
编写脚本:
[root@localhost conf]# cat status.sh #!/bin/bash if [ `curl -s http://192.168.101.110/status|awk 'NR==4 {print }' ` -ne 0 ];then echo 1 else echo 0 fi
配置zabbix配置文件
[root@localhost conf]# vim /usr/local/etc/zabbix_agentd.conf UserParameter=check_status[*],/usr/local/nginx/conf/status.sh服务端测试
[root@localhost ~]# zabbix_get -s 192.168.101.110 -k check_status
0
创建监控项
创建触发器
仪表盘警报
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)