Zabbix-4.0安装
1:配置zabbix yum仓库
1.1下载zabbix的yum源并安装
wget http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm rpm -ivh zabbix-release-4.0-1.el7.noarch.rpm
1.2:更换yum源地址为清华源地址
[root@zabbix-server ~]# vim /etc/yum.repos.d/zabbix.repo [zabbix] name=Zabbix Official Repository - $basearch baseurl=https://mirror.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX [zabbix-non-supported] name=Zabbix Official Repository non-supported - $basearch baseurl=https://mirror.tuna.tsinghua.edu.cn/zabbix/non-supported/rhel/7/$basearch/ enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX gpgcheck=1
2:安装zabbix服务端和zabbix-web前端
yum install zabbix-server-mysql zabbix-web-mysql -y
3:安装mariadb,创建zabbix库,授权zabbix用户
yum install mariadb-server -y systemctl start mariadb systemctl enable mariadb mysql_secure_installation
回车 输入 “n” 一路 “Y”
3.1:登录数据库创建库并创建zabbix登录密码
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin; MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by '123456';
3.2:导入zabbix表结构和初始数据
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p123456 zabbix
3.3:检查zabbix库是否导入成功
mysql -uroot zabbix -e 'show tables'
4:配置启动zabbix-server
4.1:创建zabbix配置文件
vim /etc/zabbix/zabbix_server.conf DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=123456
4.2:启动zabbix-server
systemctl start zabbix-server systemctl enable zabbix-server
4.3:检查:
netstat -lntup
5:修改Zabbix前端的PHP配置,并启动httpd
vim /etc/httpd/conf.d/zabbix.conf php_value date.timezone Asia/Shanghai systemctl start httpd systemctl enable httpd
6:前端zabbix-web的安装
浏览器:http://10.0.0.61/zabbix
后期修改zabbix数据库密码的时候,需要修改的配置文件:
/etc/zabbix/web/zabbix.conf.php
http://10.0.0.61/zabbix/zabbix.php
登录的账号密码;
Admin
zabbix