ZABBIX 4.0 安装
关闭防火墙及selinux
开一台linux虚拟机
1,配置yum源 zabbix.repo
vim /etc/yum.repos.d/zabbix.repo
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=http://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/$basearch/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=http://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/$basearch/debuginfo/
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=0
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=http://mirrors.aliyun.com/zabbix/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=0
2,安装zabbix 相关组件
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent mariadb mariadb-server
启动数据库
systemctl enable mariadb.service
systemctl start mariadb.service
登录数据库
mysql> create database zabbix character set utf8 collate utf8_bin; # 创建一个数据库
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'; # 授权zabbix用户拥有zabbix数据库的所有权限
mysql>flush privileges; # 刷新数据库权限表
mysql> quit;
导入zabbix初始数据库
zcat /usr/share/doc/zabbix-server-mysql-4.0.18/create.sql.gz |mysql -uzabbix -pzabbix zabbix <-库名
编辑zabbix-server配置文件,配置数据库信息
[root@node1 ~]# cat /etc/zabbix/zabbix_server.conf |grep "^DB"
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
启动所有服务
[root@node1 ~]# systemctl enable httpd zabbix-server zabbix-agent
[root@node1 ~]# systemctl start httpd zabbix-server zabbix-agent
查看相关端口是否监听:
netstat -ntlp | grep 10051 (server监听)
netstat -ntlp | grep 10050 (client监听)
时间同步
[root@node1 ~]# cat /etc/php.ini |grep -w 'date.timezone'
; http://php.net/date.timezone
date.timezone = Asia/Shanghai
重启Apache
systemctl restart httpd
中文乱码解决:
将我们选择的字体文件上传到zabbix web服务,/usr/share/zabbix/assets/fonts目录下
rm -rf graphfont.ttf
mv simkai.ttf graphfont.ttf
权限是644
chmod 644 graphfont.ttf
3,浏览器测试