您的位置:

CentOS 7安装Zabbix教程

一、CentOS 7安装源

1、备份系统原始yum源

    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、将镜像源文件下载到/etc/yum.repos.d/目录

    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3、更新yum源

    yum clean all
    yum makecache

二、CentOS 7安装

1、执行系统更新

    yum clean all && yum update -y

2、安装Zabbix所需的依赖包

    yum install -y gcc gcc-c++ curl curl-devel net-snmp net-snmp-devel wget unzip

3、安装Zabbix server和Zabbix agent

    yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent

三、CentOS 7安装YUM

1、下载Zabbix官方YUM源文件

    wget https://repo.zabbix.com/zabbix/5.4/rhel/7/x86_64/zabbix-release-5.4-1.el7.noarch.rpm

2、将Zabbix官方YUM源文件导入到yum源

    rpm -ivh zabbix-release-5.4-1.el7.noarch.rpm

3、更新yum源

    yum clean all
    yum makecache

四、CentOS6.9安装

1、使用CentOS YUM源安装依赖

    yum -y install gcc gcc-c++ make
    yum -y install libxml2 libxml2-devel
    yum -y install net-snmp net-snmp-devel net-snmp-utils
    yum -y install curl curl-devel
    yum -y install libevent libevent-devel
    yum -y install OpenIPMI OpenIPMI-devel
    yum -y install mysql mysql-devel mysql-server
    yum -y install php php-mysql php-bcmath php-gd php-xml php-mbstring

2、安装Zabbix server和Zabbix agent

    wget https://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-release-3.0-1.el6.noarch.rpm
    rpm -ivh zabbix-release-3.0-1.el6.noarch.rpm
    yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent

五、CentOS8安装源设置

1、根据系统类型下载对应的Zabbix官方YUM源文件

    CentOS/RHEL 8: wget https://repo.zabbix.com/zabbix/5.4/rhel/8/x86_64/zabbix-release-5.4-1.el8.noarch.rpm
    CentOS/RHEL 7: wget https://repo.zabbix.com/zabbix/5.4/rhel/7/x86_64/zabbix-release-5.4-1.el7.noarch.rpm

2、导入Zabbix官方YUM源文件到yum源中

    rpm -ivh zabbix-release-5.4-1.el8.noarch.rpm

六、Zabbix agent安装

1、下载Zabbix agent软件包

    wget https://repo.zabbix.com/zabbix/5.4/rhel/7/x86_64/zabbix-agent-5.4.3-1.el7.x86_64.rpm

2、安装Zabbix agent

    rpm -ivh zabbix-agent-5.4.3-1.el7.x86_64.rpm

3、修改Zabbix agent配置文件

    vim /etc/zabbix/zabbix_agentd.conf
以上就是CentOS 7安装Zabbix的详细步骤。