zabbix监控nginx status

7 篇文章 0 订阅
5 篇文章 0 订阅
本文介绍了如何在Zabbix中监控Nginx服务器的状态,包括在Nginx配置中开启status模块,编写检查脚本status.sh,更新ZabbixAgent配置以添加自定义检查参数,并在Zabbix服务器端进行测试,确保监控项正常工作。最后展示了如何在Zabbix界面创建监控项、触发器及仪表板,实现全面的Nginx状态监控。
摘要由CSDN通过智能技术生成

zabbix监控nginx status

开启状态界面

开启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.240.60/status|awk 'NR==4 {print $2}' ` -ne 0 ];then
    echo 1
else
    echo 0
fi


配置zabbix配置文件

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

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

服务端测试

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

浏览器配置监控

添加主机
在这里插入图片描述
在这里插入图片描述
创建监控项
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
创建触发器
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
仪表盘查看
在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

枯木逢秋࿐

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值