1.配置yum源
官方源:
- rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
安装官方源 - yum clean all
阿里源:
vim /etc/yum.repos.d/zabbix.repo
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/
enabled=1
gpgcheck=1
[zabbix-frontend]
name=Zabbix Official Repository frontend - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/frontend/
enabled=1
gpgcheck=1
2.安装zabbix
yum -y install yum-utils
yum install zabbix-server-mysql zabbix-agent--------安装zabbix
yum-config-manager --enable rhel-server-rhscl-7-rpms
vim etc/yum.repos.d/zabbix.repo---------------------把frontend开启
[zabbix-frontend]
enabled=1
yum install -y centos-release-scl
yum install zabbix-web-mysql-scl zabbix-apache-conf-scl
2.1.数据库
yum -y install mariadb mariadb-server----安装数据库
systemctl enable mariadb-----------------开机自启
systemctl start mariadb------------------开启数据库
mysql -u -----------------------------(默认没有密码)
授权账号:
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'lwq';
flush privileges;
2.2.初始化zabbix
在Zabbix服务器主机上导入初始模式和数据。系统将提示您输入新创建的密码。
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -plwq zabbix
3.配置zabbix
vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=lwq 这里是刚刚授权的密码。
vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
; php_value[date.timezone] = Europe/Riga
改
php_value[date.timezone] = Asia/Shanghai 注意前面的分号删掉那是注释的意思
systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm 重启服务
systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm 开机自启
访问:
http://服务器ip/zabbix
默认账号Admin 默认密码为zabbix