Zabbix 如何解决字体显示异常问题

Zabbix监控页面中文显示异常,具体为显示为方块,如图所示。

中文监控选项乱码

首先查找zabbix安装目录,找到字体具体位置。

#查找zabbix安装位置
[root@promote ~]# whereis zabbix
zabbix: /usr/lib/zabbix /etc/zabbix /usr/share/zabbix
[root@promote ~]# ls /usr/share/zabbix/
actionconf.php                 app                 charts.php                   hostinventories.php  items.php        report2.php        styles
adm.gui.php                    applications.php    conf                         host_prototypes.php  js               report4.php        sysmap.php
adm.housekeeper.php            audio               conf.import.php              host_screen.php      jsLoader.php     robots.txt         sysmaps.php
adm.iconmapping.php            auditacts.php       correlation.php              hosts.php            jsrpc.php        screenconf.php     templates.php
adm.images.php                 auditlogs.php       discoveryconf.php            httpconf.php         latest.php       screenedit.php     toptriggers.php
adm.macros.php                 browserwarning.php  disc_prototypes.php          httpdetails.php      local            screen.import.php  tr_events.php
adm.other.php                  chart2.php          favicon.ico                  image.php            locale           screens.php        trigger_prototypes.php
adm.regexps.php                chart3.php          fonts                        images               maintenance.php  search.php         triggers.php
adm.triggerdisplayoptions.php  chart4.php          graphs.php                   img                  map.import.php   services.php       usergrps.php
adm.triggerseverities.php      chart5.php          history.php                  imgstore.php         map.php          setup.php          users.php
adm.valuemapping.php           chart6.php          host_discovery.php           include              overview.php     slideconf.php      zabbix.php
adm.workingtime.php            chart7.php          hostgroups.php               index_http.php       profile.php      slides.php
api_jsonrpc.php                chart.php           hostinventoriesoverview.php  index.php            queue.php        srv_status.php
#字体文件位置
[root@promote ~]# ls /usr/share/zabbix/fonts/
graphfont.ttf
[root@promote ~]# cd /usr/share/zabbix/fonts/
[root@promote fonts]# pwd
/usr/share/zabbix/fonts
[root@promote fonts]# ls -l
总用量 0
lrwxrwxrwx. 1 root root 33 3月  25 15:24 graphfont.ttf -> /etc/alternatives/zabbix-web-font
[root@promote fonts]# 

采用winscp等工具将Windows中文字体上传到 /usr/share/zabbix/fonts/ 文件夹。本文中文字体为宋体。字体权限修改后截图如下所示:

上传字体文件

切换至/etc/alternatives 目录查看软链接。

字体软连接

删除旧软链接并新建。也可以修改为其他中文字体,例如仿宋或者微软雅黑。

#删除旧软链接
[root@promote fonts]# rm -f /etc/alternatives/zabbix-web-font
#新建软链接
[root@promote fonts]# ln -s /usr/share/zabbix/fonts/simsun.ttc  /etc/alternatives/zabbix-web-font

刷新(Ctrl+F5)浏览器页面即可,如果显示异常,请重新启动zabbix-server服务。

[root@promote fonts]# systemctl restart zabbix-server

正常显示字体如图所示。

中文字体显示正常

转载于:https://my.oschina.net/u/1011130/blog/3027513

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值