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
-