1. zabbix是运行在LAMP环境之上的,所以安装zabbix需安装其他几个软件
(1)zabbix-server端
第一步:更新yum源
rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
第二步:安装软件
-
安装zabbix 服务软件:zabbix-server-mysql
-
安装zabbix的web服务软件:zabbix-web-mysql httpd php
-
安装数据库服务软件:mariadb-server
yum install -y zabbix-web-mysql zabbix-web-mysql mariadb-server httpd php
第三步:编辑配置文件
vim /etc/zabbix/zabbix_server.conf
100行:DBName=zabbix
116行:DBUser=zabbix
126行:DBPassword=zabbix
vim / etc/httpd/conf.d/zabbix.conf
21 行加上时区: php_value date.timezone Asia/Shanghai
第四步:配置数据库服务器
开启服务
systemctl start mariadb.service
systemctl enable mariadb.server
创建zabbix数据库
create database zabbix character set utf8 collate utf8_bin;
创建数据库管理用户
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
将文件下的表导入数据库zabbix中
zcat /usr/share/doc/zabbix-server-mysql-4.0.15/create.sql.gz|mysql -uzabbix -pzabbix zabbix
第五步:启动zabbix服务
systemctl start zabbix-server.service httpd mariadb.service
systemctl enable zabbix-server.service httpd mariadb.service
第六部:登陆网站
在谷歌浏览器输入: 10.0.0.71/zabbix
- 10051 zabbix-server 服务端端口号
- 10050 zabbix-agent 客户端端口号
- /etc/zabbix/web/zabbix.conf.php – 记录web页面初始化信息
第七步:初始化zabbix登录密码
账号:Admin 密码:zabbix