本文采用操作系统:CentOS7.3 x64
需要epel源
rpm -ivh epel-release-latest-7.noarch.rpm
2. 下载zabbix rpm安装包
wget http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-agent-3.2.6-1.el7.x86_64.rpm
wget http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-get-3.2.6-1.el7.x86_64.rpm
wget http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-proxy-mysql-3.2.6-1.el7.x86_64.rpm
wget http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2.6-1.el7.noarch.rpm
wget http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-sender3.2.6-1.el7.x86_64.rpm
wget http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-server-mysql-3.2.6-1.el7.x86_64.rpm
wget http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-web-3.2.6-1.el7.noarch.rpm
wget http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-web-mysql-3.2.6-1.el7.noarch.rpm
3. 查看zabbix需要的安装包
yum install zabbix-*
4. 安装mysql社区版官方版
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install -y mysql-community-server
5. 启动mysql
systemctl enable mysqld
systemctl start mysqld
创建密码:
mysql_secure_installation
mysql -uroot -p
6. 创建zabbix数据库并授权
mysql -uroot -p
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
mysql> flush privileges;
mysql> quit;
7. 导入zabbix数据库
zcat /usr/share/doc/zabbix-server-mysql-3.2.6/create.sql.gz | mysql -uzabbix -pzabbix -b zabbix
8. 修改zabbix配置,主要是zabbix数据库用户名和密码的设定
# vi /etc/zabbix/zabbix_server.conf
配置默认数据库用户名
DBUser=zabbix
DBPassword=zabbix
其他可以默认
9. 启动zabbix服务,并设置开机自启
systemctl enable zabbix-server
systemctl start zabbix-server
10. 编辑zabbix前端的php配置,更改下时区
vi /etc/httpd/conf.d/zabbix.conf
去掉时区前的#号,改一下位置
php_value date.timezone Asia/Shanghai
11. 启动apache服务,并设置开机自启
systemctl enable httpd
systemctl start httpd
12. 登录zabbix
http://xxx.xxx.xxx.xxx/zabbix
用户名Admin/zabbix
13. 其它问题
解决默认(Template OS Linux)负载值不对问题:
修改模板(Template OS Linux)--项目--Processor load (1、5、15 min average per core)键值:
把 system.cpu.load[percpu,avg1] 改为 system.cpu.load[all,avg1]
把 system.cpu.load[percpu,avg5] 改为 system.cpu.load[all,avg5]
把 system.cpu.load[percpu,avg15] 改为 system.cpu.load[all,avg15]
大型站长资讯类网站! https://www.0818zz.com