一、加入国内镜像
vim /etc/yum.repos.d/openEuler.repo
[appstream]
name=appstream
baseurl=https://mirrors.aliyun.com/centos-stream/9-stream/AppStream/x86_64/os
gpgcheck=0
enabled=1
二、下载、安装
wget https://cdn.zabbix.com/zabbix/sources/stable/6.0/zabbix-6.0.13.tar.gz
yum install gcc pcre-devel make -y
tar -zxvf zabbix-5.0.37.tar.gz
make install
mkdir /etc/zabbix
cp /usr/local/etc/zabbix_agentd.conf /etc/zabbix/zabbix_agentd.conf
三、更改服务器IP
vim zabbix_agentd.conf
Server=服务器IP
ServerActive=服务器IP
四、创建服务
vim /lib/systemd/system/zabbix-agent.service
[Unit]
Description=Zabbix Agent
After=syslog.target
After=network.target[Service]
Environment="CONFFILE=/etc/zabbix/zabbix_agentd.conf"
EnvironmentFile=-/etc/sysconfig/zabbix-agent
Type=forking
KillMode=control-group
ExecStart=/usr/local/sbin/zabbix_agentd -c $CONFFILE
ExecStop=/bin/kill -SIGTERM $MAINPID
User=daemon
Group=daemon[Install]
WantedBy=multi-user.target
五、开启zabbix agent服务
firewall-cmd --add-port=10050/tcp --permanent
firewall-cmd --reload
systemctl start zabbix-agent