zabbix服务端
[root@127 ~]# cat /etc/redhat-release
CentOS Linux release 8.3.2011
客户端
[root@mysql ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
配置zabbix源
[root@mysql ~]# rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm # 获取zabbix源
[root@mysql ~]# sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/yum.repos.d/zabbix.repo # 更换zabbix.repo源为阿里的
1.安装agent2
[root@mysql ~]# yum install zabbix-agent2 -y
2.配置文件
[root@mysql ~]# vi /etc/zabbix/zabbix_agent2.conf
Server=192.168.13.74 # 服务器IP
ServerActive=192.168.13.74 #服务器IP
Hostname=mysql # 客户端主机名
[root@test ~]# cat /etc/zabbix/zabbix_agent2.conf |grep -v "^#"|sed '/^$/d'
PidFile=/var/run/zabbix/zabbix_agentd2.pid
LogFile=/var/log/zabbix/zabbix_agentd2.log
LogFileSize=0
Server=192.168.13.74
ServerActive=192.168.13.74
Hostname=test
Include=/etc/zabbix/zabbix_agent2.d/*.conf
3.启动agent并设置开机自启
[root@mysql ~]# systemctl enable --now zabbix-agent2