通过 Zabbix 服务,监控 Nginx Status (详细示例)

1、组网拓扑

在这里插入图片描述

2、准备工作,可查看此链接,此文不做累述

Zabbix Server 和 Zabbix Agent 的详细安装过程(附带监控主机和监控参数的详细设置)

3、Zabbix Agent 安装 Nginx,并修改配置文件,并启动 Nginx

[root@Tang-1 ~]# yum install nginx -y
[root@Tang-1 ~]# vim /etc/nginx/nginx.conf
http {
   
	server {
		listen       80;
        server_name  localhost;

		location /ngxstatus {
   
            stub_status;
         }
	}
}
[root@Tang-1 ~]# systemctl start nginx.service
[root@Tang-1 ~]# systemctl status nginx.service
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
   Active: active (running) since Tue 2019-10-29 18:59:26 CST; 19h ago
  Process: 16262 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
  Process: 16257 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
  Process: 16254 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
 Main PID: 16263 (nginx)
   CGroup: /system.slice/nginx.service
           ├─16263 nginx: master process /usr/sbin/nginx
           └─16264 nginx: worker process

Oct 29 18:59:26 Tang-1 systemd[1]: Starting The nginx HTTP and reverse proxy server...
Oct 29 18:59:26 Tang-1 nginx[16257]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Oct 29 18:59:26 Tang-1 nginx[16257]: nginx: configuration file /etc/nginx/nginx.conf test is successful
Oct 29 18:59:26 Tang-1 systemd
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值