解决zabbix中文显示乱码问题

本文详细介绍了在Zabbix中解决中文显示问题及图表乱码的方法。通过修改locales.inc.php文件,安装并配置Wqy Microhei字体,实现Zabbix界面的中文正常显示。若遇到字体安装问题,提供了更新yum源的步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

中文显示问题,图表乱码

wpsE8EF.tmp

解决办法:

[root@zabbix ~]# cd /usr/share/zabbix/include/
[root@zabbix include]# vim locales.inc.php 
 58            'zh_CN' => array('name' => _('Chinese (zh_CN)'),        'display' => true),

安装字体
[root@zabbix ~]# yum -y install wqy-microhei-fonts 
[root@zabbix ~]# cd /etc/alternatives/
[root@zabbix alternatives]# ll zabbix-web-font 
lrwxrwxrwx. 1 root root 38 Jun  6 00:22 zabbix-web-font -> /usr/share/fonts/dejavu/DejaVuSans.ttf
[root@zabbix alternatives]# rm -f zabbix-web-font 
[root@zabbix alternatives]# rpm -ql wqy-microhei-fonts 
/etc/fonts/conf.d/65-0-wqy-microhei.conf
/usr/share/doc/wqy-microhei-fonts-0.2.0
/usr/share/doc/wqy-microhei-fonts-0.2.0/LICENSE_Apache2.txt
/usr/share/doc/wqy-microhei-fonts-0.2.0/LICENSE_GPLv3.txt
/usr/share/doc/wqy-microhei-fonts-0.2.0/README.txt
/usr/share/fontconfig/conf.avail/65-0-wqy-microhei.conf
/usr/share/fonts/wqy-microhei
/usr/share/fonts/wqy-microhei/wqy-microhei.ttc
[root@zabbix alternatives]# ln -s /usr/share/fonts/wqy-microhei/wqy-microhei.ttc  /etc/alternatives/zabbix-web-font

刷新之后,显示正常

wpsEAFF.tmp

若yum没有发现字体,可以先安装yum源

\cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo 
 wget -qO /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
 yum clean metadata

转载于:https://www.cnblogs.com/aresxin/p/5010838.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值