Zabbix笔记 -- 客户端添加

  1. 安装Nginx

参考:http://nginx.org/en/linux_packages.html#RHEL-CentOS

[root@nginx ~]# vi /etc/yum.repos.d/nginx.repo
[root@nginx ~]# cat /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
[root@nginx ~]# dnf install nginx -y
  1. 安装Zabbix-Agent
[root@nginx ~]# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
[root@nginx ~]# dnf clean all
[root@nginx ~]# dnf install zabbix-agent
  1. 备份Zabbix-Agent配置文件
[root@nginx ~]# cp /etc/zabbix/zabbix_agentd.conf{,.bak}
[root@nginx ~]# sed -E '/^#|^$/d' /etc/zabbix/zabbix_agentd.conf 
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=127.0.0.1
ServerActive=127.0.0.1
Hostname=Zabbix server
Include=/etc/zabbix/zabbix_agentd.d/*.conf
[root@nginx ~]# sed -E '/^#|^$/d' /etc/zabbix/zabbix_agentd.conf.bak > /etc/zabbix/zabbix_agentd.conf
[root@nginx ~]# 
  1. 修改Zabbix-Agent配置文件
[root@nginx ~]# echo "13.13.100.100 zabbix" > /etc/hosts
[root@nginx ~]# sed -i 's/127.0.0.1/zabbix/g' /etc/zabbix/zabbix_agentd.conf
[root@nginx ~]# sed -i 's/Zabbix server/Nginx/g' /etc/zabbix/zabbix_agentd.conf
[root@nginx ~]# cat /etc/zabbix/zabbix_agentd.conf
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=zabbix
ServerActive=zabbix
Hostname=Nginx
Include=/etc/zabbix/zabbix_agentd.d/*.conf
[root@nginx ~]# 
  1. 配置防火墙
[root@nginx ~]# firewall-cmd --permanent --add-service=zabbix-agent 
[root@nginx ~]# firewall-cmd --permanent --add-service=http
[root@nginx ~]# firewall-cmd --reload
[root@nginx ~]# 
  1. 开启服务
[root@nginx ~]# systemctl enable nginx.service zabbix-agent.service 
[root@nginx ~]# systemctl start nginx.service zabbix-agent.service 
[root@nginx ~]#
  1. 服务端测试连通性
[root@zabbix ~]# dnf install zabbix-get -y
[root@zabbix ~]# zabbix_get -s 13.13.50.1 -k agent.hostname
Nginx
[root@zabbix ~]# 
  1. 添加新的监控主机

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值