zabbix设置中文并解决乱码问题

1、首次登陆zabbix,默认为“English (en_US)”,若修改为中文"Chinese (zh_CN)",如下图:

2、对于zabbix初学者,基本都会出现图形展示中文乱码,这是因为Zabbix自带字体“graphfont.ttf”导致的,默认字体目录为:

[root@localhost fonts]# pwd
/usr/share/zabbix/assets/fonts

3、解决方法一般是通过自己的本机上找个中文字体上传上去就能解决。

window系统一般都是目录:C:\Windows\Fonts

zabbix linux创建目录: /usr/share/zabbix/fonts (可以直接使用在原目录,后面目录的配置可以不需要修改)

[root@localhost zabbix]# cd /usr/share/zabbix
[root@localhost zabbix]# ls
[root@localhost zabbix]# mkdir fonts

选择“仿宋 常规”简体字(任意选择中文字体可),上传:

[root@localhost zabbix]# cd fonts/
[root@localhost fonts]# ls
[root@localhost fonts]# rz
rz waiting to receive.
 zmodem trl+C ȡ

  100%   10328 KB 10328 KB/s 00:00:01       0 Errors

[root@localhost fonts]# ls
simfang.ttf
[root@localhost fonts]# cd ../

在目录/usr/share/zabbix/inclide下,修改配置文件defines.inc.php

[root@localhost zabbix]# cd include/
[root@localhost include]# ls
actions.inc.php      events.inc.php          items.inc.php         regexp.inc.php
audit.inc.php        forms.inc.php           js.inc.php            schema.inc.php
blocks.inc.php       func.inc.php            locales.inc.php       screens.inc.php
classes              gettextwrapper.inc.php  maintenances.inc.php  services.inc.php
config.inc.php       graphs.inc.php          maps.inc.php          sounds.inc.php
correlation.inc.php  hostgroups.inc.php      media.inc.php         translateDefines.inc.php
db.inc.php           hosts.inc.php           menu.inc.php          triggers.inc.php
debug.inc.php        html.inc.php            page_footer.php       users.inc.php
defines.inc.php      httptest.inc.php        page_header.php       validate.inc.php
discovery.inc.php    ident.inc.php           perm.inc.php          valuemap.inc.php
draw.inc.php         images.inc.php          profiles.inc.php      views
[root@localhost include]# vi defines.inc.php 

defines.inc.php打开后,修改字体目录和指定字体,使用vi 如下命令快速定位:

:n           //行定位  n为65行左右

/ZBX_GRAPH_FONT_NAME    //向后查找

?ZBX_GRAPH_FONT_NAME  //向前查找

修改前:


define('ZBX_WIDGET_ROWS', 20);

define('ZBX_FONTPATH',                          realpath('assets/fonts')); // where to search for font (GD > 2.0.18)
define('ZBX_GRAPH_FONT_NAME',           'graphfont'); // font file name 'graphfont'
define('ZBX_GRAPH_LEGEND_HEIGHT',       120); // when graph height is less then this value, some lege

修改后:


define('ZBX_FONTPATH',                          realpath('fonts')); // where to search for font (GD > 2.0.18)'assets/fonts'
define('ZBX_GRAPH_FONT_NAME',           'simfang'); // font file name 'graphfont'
define('ZBX_GRAPH_LEGEND_HEIGHT',       120); // when graph height is less then this value, some legend will not show up

4、更换如好后,测试如下:

“监控”-》图形-》CPU load

 

 


-

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值