zabbix监控nginx status

zabbix监控nginx status

开启状态界面

开启status:

[root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf

    location / {
            root   html;
            index  index.html index.htm;
        }

    location /status {
            stub_status;
        }

[root@localhost ~]# nginx -s reload

编写脚本

[root@localhost ~]# mkdir /script
[root@localhost ~]# vim /script/status.sh
#!/bin/bash

curl -s http://192.168.100.110/status|awk 'NR==4 {print $2}'

配置zabbix配置文件

[root@localhost ~]# vim /usr/local/etc/zabbix_agentd.conf

# Default: SOMAXCONN (hard-coded constant, depends on system)
# ListenBacklog=
UserParameter=check_status[*],/script/status.sh

服务端测试

[root@localhost ~]# zabbix_get -s 192.168.100.110 -k check_status
0

浏览器配置监控

zabbix监控nginx status
zabbix监控nginx status
zabbix监控nginx status
zabbix监控nginx status]

上一篇:RequestContextHolder实践整理


下一篇:关于Webview如何自动登录保存登录信息