-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
- 下载与解压
wget https://cdn.zabbix.com/zabbix/sources/stable/5.0/zabbix-5.0.46.tar.gz
tar xvf zabbix-5.0.46.tar.gz
cd zabbix-5.0.46
- 创建用户和组
bashgroupadd zabbix
useradd zabbix -g zabbix -s /sbin/nologin
- 安装依赖
yum install -y gcc libxml2-devel libevent-devel net-snmp net-snmp-devel curl curl-devel php php-bcmath php-mbstring mariadb mariadb-devel java-1.6.0-openjdk-devel --skip-broken
yum install pcre pcre-devel -y
- 编译配置
./configure --enable-agent
- 配置Zabbix代理
cd /usr/local/etc/
nano zabbix_agentd.conf
Server=xxx.xxx.xxx.xx
- 创建Systemd服务
nano /usr/lib/systemd/system/zabbix-agent.service
服务文件内容:
[Unit]
Description=Zabbix Agent
After=syslog.target
After=network.target
[Service]
Environment="CONFFILE=/usr/local/etc/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
- 启动服务
systemctl daemon-reload
systemctl start zabbix-agent
systemctl enable zabbix-agent
Ref: https://blog.csdn.net/2401_84494441/article/details/139498092
Metadata
Metadata
Assignees
Labels
No labels