zabbix监控nginx status

本文介绍了如何使用Zabbix监控Nginx的状态,包括开启Nginx的status页面,编写监控脚本,配置Zabbix配置文件,以及在服务端和浏览器端进行测试。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

浏览器配置监控

CkATd1.png
CkAWVK.png
CkAc2o.png
CkAOXb.png]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值