一、环境
系统安装镜像:CentOS-7-x86_64-DVD-1908.iso安装时选为精简系统

下载zabbix yum源文件
rpm -ivh http://mirrors.aliyun.com/zabbix/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm 
yum工具在线安装zabbix-LMLPHP
# yum install zabbix-server-mysqlzabbix-web-mysql mariadb-server zabbix-agent -y

# systemctl start mariadb
# mysql \
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]>create user zabbix@localhost identified by 'zabbix';
Query OK, 0 rows affected (0.01 sec)
MariaDB [(none)]>grant all privileges on zabbix.* to zabbix@localhost;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> quit
Bye
[root@localhost ~]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
Enter password:
[root@localhost ~]#

d. 为Zabbix server配置数据库

编辑配置文件 /etc/zabbix/zabbix_server.conf

DBPassword=password
e. 为Zabbix前端配置PHP

编辑配置文件 /etc/httpd/conf.d/zabbix.conf, uncomment and set the right timezone for you.

# php_value date.timezone Europe/Riga
f. 启动Zabbix server和agent进程

启动Zabbix server和agent进程,并为它们设置开机自启:

# systemctl restart zabbix-server zabbix-agent httpd
# systemctl enable zabbix-server zabbix-agent httpd 防火墙关闭
systemctl stop firewalld.service



09-22 10:01