上一篇已经介绍了如何在vbox上安装centos7,现在就可以在虚拟机上安装zabbix,我现在用的是yum安装,以后有时间会去了解下编译安装.
1.安装zabbix源
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
2.安装zabbix
yum install -y zabbix-server-mysql zabbix-web-mysql
3.安装玛雅数据库,以及创建导入数据(导入数据的目录根据版本不同会有一些差异)
yum install -y mariadb-server
systemctl start mariadb.service
mysql -e 'create database zabbix character set utf8 collate utf8_bin;' mysql -e 'grant all privileges on zabbix.* to zabbix@localhost identified by "zabbix";'
zcat /usr/share/doc/zabbix-server-mysql-3.0.15/create.sql.gz|mysql -uzabbix -pzabbix zabbix
4.配置zabbixserver连接mysql
sed -i.ori '115a DBPassword=zabbix' /etc/zabbix/zabbix_server.conf
5.添加时区
sed -i.ori '18a php_value date.timezone Asia/Shanghai' /etc/httpd/conf.d/zabbix.conf
6.解决中文乱码
yum -y install wqy-microhei-fonts \cp /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf
7. Centos7 中 gnutls.x86_64 (gnutls.x86_64 3.3.8-14.el7_2 ) 版本过高,需要降级 3.1.18-8.el7(1.20) https://www.cnblogs.com/liushen/p/5775857.html
wget ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/7.0/x86_64/os/Packages/gnutls-3.1.18-8.el7.x86_64.rpm
rpm -Uvh --force gnutls-3.1.18-8.el7.x86_64.rpm
8.启动服务
systemctl start zabbix-server
systemctl start httpd
9.访问 http://192.168.137.123/zabbix