1、配置阿里雲zabbix yum源
[root@VM_0_8_centos ~]# rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
2、安裝相關軟件
yum install zabbix-server zabbix-web zabbix-server-mysql zabbix-web-mysql mariadb-server mariadb zabbix-agent -y
3、修改PHP時區配置
[root@VM_0_8_centos ~]# vim /etc/httpd/conf.d/zabbix.conf
將<IfModule mod_php5.c>塊的注釋打開並且修改時區為Asia/Shanghai
php_value date.timezone Asia/Shanghai
4、數據庫配置
由於我們安裝的是mariadb數據庫所以啟動的是mariadb
[root@VM_0_8_centos ~]# systemctl start mariadb
5、創建zabbix 所用的數據庫以及用戶
進入數據庫
[root@VM_0_8_centos ~]# mysql
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
MariaDB [(none)]> grant all on zabbix.* to zabbix@'%' identified by '123456';
MariaDB [(none)]> grant all on zabbix.* to zabbix@'localhost' identified by '123456';
MariaDB [(none)]> exit;
導入zabbix數據
[root@VM_0_8_centos ~]# cd /usr/share/doc/zabbix-server-mysql-3.0.28
[root@VM_0_8_centos ~]# zcat create.sql.gz |mysql -uzabbix -p123456 zabbix
6、修改zabbix配置文件
[root@VM_0_8_centos ~]# vim /etc/zabbix/zabbix_server.conf
DBHost=localhost #數據庫所在主機
DBName=zabbix #數據庫名
DBUser=zabbix #數據庫用戶
DBPassword=123456 #數據庫密碼
7、啟動zabbix及http
[root@VM_0_8_centos ~]# systemctl start httpd.service
[root@VM_0_8_centos ~]# systemctl start zabbix-server.service
8、用瀏覽器訪問http://zabbix-server服務端的IP地址/zabbix/setup.php
9、配置zabbix-agent 客戶端以及啟動
[root@VM_0_8_centos ~]# vim /etc/zabbix/zabbix_agentd.conf
Server=127.0.0.1 #zabbix-server地址
ServerActive=127.0.0.1 #zabbix-server地址(主動模式)
[root@VM_0_8_centos ~]# systemctl start zabbix-agent.service
10、檢查一下zabbix-server和zabbix-agent
[root@VM_0_8_centos ~]# ss -lntp | grep zabbix
11、在瀏覽器zabbix-server端操作
12、至此簡單的zabbix安裝完畢,可以根據自己的實際情況修改zabbix的不同參數