一、关闭SELinux和防火墙
二、安装数据库
yum -y install mariadb-server mariadb-devel
配置数据库
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to ‘zabbix’@‘localhost’ identified by ‘123456’;
flush privileges;
exit
三、安装zabbix
下载源:wget http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
安装:rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
安装zabbix相关的包
yum install -y zabbix-get zabbix-sender zabbix-server-mysql zabbix-web zabbix-web-mysql zabbix-agent
cd /usr/share/doc/zabbix-server-mysql-3.2.4/
解压create.sql.gz这个文件
gunzip create.sql.gz
把这个create.sql导入到数据库中
mysql -uzabbix -p zabbix < create.sql
修改zabbix_server_conf这个配置文件
vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBPassword=123456
DBUser=zabbix
DBSocket=/var/lib/mysql/mysql.sock
修改/etc/httpd/conf.d/zabbix.conf文件(修改时区)
php_value date.timezone Asia/Shanghai //改为亚洲/上海
开启一系列服务,包括Apache、Mariadb、zabbix-server、zabbix-agent
systemctl start httpd.service
systemctl start mariadb
systemctl start zabbix-server
systemctl start zabbix-agent
把服务设置成开机启动
systemctl enable httpd
systemctl enable mariadb
systemctl enable zabbix-server
systemctl enable zabbix-agent
打开浏览器进行安装
输入 http://主机IP地址/zabbix
账号密码默认为:Admin(开头字母大写) zabbix