CentOS7之CentOS7安装zabbix3.x(一)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_33733970/article/details/82017457

安装zabbix3.x

rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm 
yum install zabbix-server-mysql zabbix-web-mysql zabbix-get -y

安装数据库:

yum install mariadb-server mariadb 

systemctl start mariadb  #启动MariaDB

systemctl stop mariadb  #停止MariaDB

systemctl restart mariadb  #重启MariaDB

使用数据库(无账号密码):

sudo mysql
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
Query OK, 0 rows affected (0.08 sec)
MariaDB [(none)]> exit
Bye

导入数据库数据:

sudo mysql -Dzabbix < create.sql

重新来:

  1. 添加epel源(CentOS7.x)

    yum install epel-release

  2. 安装依赖:

    yum -y install gcc httpd php php-devel php-mysql curl-devel libssh2-devel libevent-devel php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-bcmath mariadb mariadb-server mariadb-devel libdbi-dbd-mysql curl-devel mod_ssl mod_auth_mysql mod_perl net-snmp net-snmp-devel net-snmp-utils

  3. 创建系统用户和mariadb

    useradd -M -r -s /sbin/nologin zabbix
    开机启动:systemctl enable mariadb
    启动服务:systemctl start mariadb
    mysql -uroot
    create database zabbix character set utf8 collate utf8_bin;
    grant all privileges on zabbix.* to zabbix@’localhost’ identified by ‘zabbix’;

  4. 下载zabbix源码包并解压:

    wget https://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.4.1/zabbix-3.4.1.tar.gz
    tar -xzvf zabbix-3.4.1.tar.gz
    cd zabbix-3.4.1/
    mysql -uroot zabbix < database/mysql/schema.sql

  5. 编译安装zabbix

    ./configure \
    –prefix= /usr/local/zabbix \
    –enable-server \
    –enable-agent \
    –enable-proxy \
    –with-mysql \
    –enable-ipv6 \
    –with-net-snmp \
    –with-libcurl \
    –with-ssh2

如图:

猜你喜欢

转载自blog.csdn.net/qq_33733970/article/details/82017457
今日推荐