特别说明:该环境运行在centos7.9版本minimal install系统上 zabbix版本在5.0LTS 版本

执行以下命令 进行安装zabbix-agent

禁止selinux使用
需要重启服务器

sed -i 's#SELINUX=enforcing#SELINUX=disabled#' /etc/selinux/config
reboot

引用阿里云镜像源 zabbix镜像替换成阿里云

rm -rf /etc/yum.repos.d/*
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/yum.repos.d/zabbix.repo
sed -i 's#enabled=0#enabled=1#' /etc/yum.repos.d/zabbix.repo

清除缓存,更新源

yum clean all
yum makecache
yum update

安装zabbix相关组件

yum install  -y vim
yum install -y zabbix-agent.x86_64

修改zabbix配置文件

vim /etc/zabbix/zabbix_agentd.conf 

修改内容
Server=替换成zabbix-server服务器ip
ServerActive=替换成zabbix-server服务器ip
按esc :wq保存退出

启动zabbix服务

systemctl start zabbix-agent
systemctl enable zabbix-agent

开启端口

firewall-cmd --add-port=10051/tcp --permanent
firewall-cmd --add-port=10050/tcp --permanent
firewall-cmd --reload
Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐