ddddddf 发表于 2019-1-20 14:02:32

CentOS 7 yum安装zabbix 设置中文界面

1、配置安装前环境
2、安装zabbix
3、设置中文环境
https://images2018.cnblogs.com/blog/1443200/201808/1443200-20180804165629557-995018750.png

准备搭建环境 :
系统:CentOS7.5
首先关闭SElinux 和防火墙

安装MariaDB数据库
# yum -y install mariadb-server mariadb-devel
# systemctl start mariadb
# mysql
Welcome to the MariaDB monitor.Commands end with ; or \g.
Your MariaDB connection id is 2Server version: 5.5.56-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>flush privileges;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> quit
Bye安装zabbix :
获取并安装zabbix的yum源
# wget http://repo.zabbix.com/zabbix/3.5/rhel/7/x86_64/zabbix-release-3.5-1.el7.noarch.rpm# rpm -i zabbix-release-3.5-1.el7.noarch.rpm
# yum makecache
# yum -y install zabbix-get zabbix-sender zabbix-server-mysqlzabbix-web zabbix-agentzabbix-agent.:zabbix客户端,用来收集客户端各种参数
zabbix-get:zabbix的一个工具,用来检查是否可以获取服务器信息(一般服务端要安装)
zabbix-sender:用于发送数据给server或者proxy
zabbix-web:zabbix要使用web界面,这个包是用来处理Apache和php,mysql等之间的依赖关系

把create.sql导入到zabbix数据库中

# cd /usr/share/doc/zabbix-server-mysql-4.0.0/
# mysql -u zabbix -p zabbix < create.sql Enter password:123456修改zabbix_server_conf这个配置文件
# vim /etc/zabbix/zabbix_server.conf
在# DBPassword=下面添加 DBPassword=123456
在# DBSocket=/tmp/mysql.sock下面添加
DBSocket=/var/lib/mysql/mysql.sock
# vim /etc/httpd/conf.d/zabbix.conf# 把时区修改为亚洲/上海
php_value date.timezone Asia/Shanghai开启服务
# systemctl start httpd
# systemctl start zabbix-server
# systemctl start zabbix-agent在浏览器安装zabbix
安装地址:
http://ip/zabbix (ip替换为自己ip)
https://images2018.cnblogs.com/blog/1443200/201808/1443200-20180804173054544-1656013196.png
https://images2018.cnblogs.com/blog/1443200/201808/1443200-20180804173137985-743772180.png
在配置数据库的时候只有postgresql数据库,没有mysql怎么办?
# yum -y install php-mysql
# systemctl restart httpd刷新页面
https://images2018.cnblogs.com/blog/1443200/201808/1443200-20180804173514329-210875311.png
https://images2018.cnblogs.com/blog/1443200/201808/1443200-20180804173456161-1483365649.png
https://images2018.cnblogs.com/blog/1443200/201808/1443200-20180804173615425-1494131957.png
https://images2018.cnblogs.com/blog/1443200/201808/1443200-20180804173636060-1154309956.png
登录,用户名密码为Admin/zabbix
https://images2018.cnblogs.com/blog/1443200/201808/1443200-20180804173738237-1873208715.png
https://images2018.cnblogs.com/blog/1443200/201808/1443200-20180804173957340-1283022440.png
修改页面中文显示
https://images2018.cnblogs.com/blog/1443200/201808/1443200-20180804174107237-1795783924.png
https://images2018.cnblogs.com/blog/1443200/201808/1443200-20180804174139591-1948026132.png
修改成中文保存
https://images2018.cnblogs.com/blog/1443200/201808/1443200-20180804174305085-2063099971.png
https://images2018.cnblogs.com/blog/1443200/201808/1443200-20180804174342232-899765078.png
现在是中文 , 但是有些参数显示不出来 , 乱码了 , 怎么解决呢?
https://images2018.cnblogs.com/blog/1443200/201808/1443200-20180804174843730-490923439.png
需要修改中文字体 ,防止监控图乱码
在控制面板中找到一个字体 ,例如黑体
Win+R 输入Control
https://images2018.cnblogs.com/blog/1443200/201808/1443200-20180804175150632-1069175779.png
https://images2018.cnblogs.com/blog/1443200/201808/1443200-20180804175244504-151928322.png
https://images2018.cnblogs.com/blog/1443200/201808/1443200-20180804175341898-1698951073.png

把字体文件上传到/usr/share/zabbix/fonts
# cd /usr/share/zabbix/fonts/
#graphfont.ttf
# rz -E # 上传字体文件到当前目录下
rz waiting to receive.
#graphfont.ttfSIMHEI.TTF
# 把文件名改为小写 #SIMHEI.TTF simhei.ttf
# 修改/usr/share/zabbix/include/defines.inc.php
#-i/usr/share/zabbix/include/defines.inc.php刷新监控页面
https://images2018.cnblogs.com/blog/1443200/201808/1443200-20180804180513658-364319236.png
已经正常显示中文




页: [1]
查看完整版本: CentOS 7 yum安装zabbix 设置中文界面