0. 更改主机名,查看系统版本
1. 将以下代码复制粘贴到Linux保存后执行. 重启系统生效
#!/bin/bash set -ex # Install Zabbix repository systemctl stop firewalld systemctl stop NetworkManager systemctl disable firewalld NetworkManager rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm yum clean all # Install Zabbix server and agent yum install -y zabbix-server-mysql zabbix-agent # Install Zabbix frontend sed -i.bak '/zabbix-frontend/,+5 s/enabled=0/enabled=1/g' /etc/yum.repos.d/zabbix.repo yum install -y centos-release-scl # Install Zabbix frontend packages. yum install -y zabbix-web-mysql-scl zabbix-apache-conf-scl # 创建初始数据库 yum install -y mariadb-server systemctl restart mariadb systemctl enable mariadb mysqladmin -uroot password 'root' mysql -uroot -proot -e "use mysql;delete from user where password='';" mysql -uroot -proot -e "use mysql;select user,password,host from user;" sleep 5 mysql -uroot -proot -e "create database zabbix character set utf8 collate utf8_bin;" mysql -uroot -proot -e "create user 'zabbix'@'%' identified by 'zabbix';" mysql -uroot -proot -e "grant all privileges on zabbix.* to 'zabbix'@'%';" mysql -uroot -proot -e "flush privileges;" systemctl restart mariadb #导入初始架构和数据,系统将提示您输入新创建的密码。 zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -pzabbix zabbix # 为Zabbix server配置数据库 sed -i '/DBPassword=/aDBPassword=zabbix' /etc/zabbix/zabbix_server.conf # 为Zabbix前端配置PHP sed -i '/php_value[date.timezone]/aphp_value[date.timezone] = Asia/Shanghai' /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf #启动Zabbix server和agent进程,并为它们设置开机自启 systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm
2. reboot后;登录http://ZabbixServerIP/zabbix进行Installing frontend
3. 默认账户名密码为Admin/zabbix
4.切换界面为中文显示
5. 将windows下字体替换Linux下zabbix字体文件;
Windows位置: C:windowsfontssimkai.tff
Linux位置: /usr/share/zabbix/assets/fonts/graphfont.ttf
将simkai.tff放置在/tmp目录下
mv /tmp/simkai.ttf /usr/share/zabbix/assets/fonts/graphfont.ttf