Skip to content

zabbix 源码安装 #2

@CHN-STUDENT

Description

@CHN-STUDENT
  1. 下载与解压
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
  1. 创建用户和组
bashgroupadd zabbix
useradd zabbix -g zabbix -s /sbin/nologin
  1. 安装依赖
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
  1. 编译配置
./configure --enable-agent
  1. 配置Zabbix代理
cd /usr/local/etc/
nano zabbix_agentd.conf
Server=xxx.xxx.xxx.xx
  1. 创建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
  1. 启动服务
systemctl daemon-reload
systemctl start zabbix-agent
systemctl enable zabbix-agent

Ref: https://blog.csdn.net/2401_84494441/article/details/139498092

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions