Zabbix安装好之后,监控图形页面出现字符集乱码
红色部分一般会变为乱码现在,此处是因为zabbix自身对中文简体的支持不完善,需要我们手动的去上传新的字体进行替换。
1、在windows获取字体库文件,首先选择一个你需要的字体,下载并上传到系统中。
2、查看/etc/alternatives/zabbix-web-font目录,发现这儿原来是个软链接,它指向的是一个字体库。
[root@centos7 ~]# ll /etc/alternatives/zabbix-web-font
lrwxrwxrwx 1 root root 38 12月 3 12:26 /etc/alternatives/zabbix-web-font -> /usr/share/fonts/dejavu/DejaVuSans.ttf
[root@centos7 ~]# ll /usr/share/fonts/dejavu/
总用量 9040
-rw-r--r--. 1 root root 611212 2月 27 2011 DejaVuSans-BoldOblique.ttf
-rw-r--r--. 1 root root 672300 2月 27 2011 DejaVuSans-Bold.ttf
-rw-r--r--. 1 root root 580168 2月 27 2011 DejaVuSansCondensed-BoldOblique.ttf
-rw-r--r--. 1 root root 631992 2月 27 2011 DejaVuSansCondensed-Bold.ttf
-rw-r--r--. 1 root root 576004 2月 27 2011 DejaVuSansCondensed-Oblique.ttf
-rw-r--r--. 1 root root 643852 2月 27 2011 DejaVuSansCondensed.ttf
-rw-r--r--. 1 root root 345204 2月 27 2011 DejaVuSans-ExtraLight.ttf
-rw-r--r--. 1 root root 235848 2月 27 2011 DejaVuSansMono-BoldOblique.ttf
-rw-r--r--. 1 root root 313856 2月 27 2011 DejaVuSansMono-Bold.ttf
-rw-r--r--. 1 root root 241968 2月 27 2011 DejaVuSansMono-Oblique.ttf
-rw-r--r--. 1 root root 333632 2月 27 2011 DejaVuSansMono.ttf
-rw-r--r--. 1 root root 611556 2月 27 2011 DejaVuSans-Oblique.ttf
-rw-r--r--. 1 root root 720012 2月 27 2011 DejaVuSans.ttf
-rw-r--r--. 1 root root 332036 2月 27 2011 DejaVuSerif-BoldItalic.ttf
-rw-r--r--. 1 root root 341072 2月 27 2011 DejaVuSerif-Bold.ttf
-rw-r--r--. 1 root root 331128 2月 27 2011 DejaVuSerifCondensed-BoldItalic.ttf
-rw-r--r--. 1 root root 316440 2月 27 2011 DejaVuSerifCondensed-Bold.ttf
-rw-r--r--. 1 root root 338140 2月 27 2011 DejaVuSerifCondensed-Italic.ttf
-rw-r--r--. 1 root root 330012 2月 27 2011 DejaVuSerifCondensed.ttf
-rw-r--r--. 1 root root 338776 2月 27 2011 DejaVuSerif-Italic.ttf
-rw-r--r--. 1 root root 363200 2月 27 2011 DejaVuSerif.ttf
因此把上传到系统的字体复制到/usr/share/fonts/dejavu/目录下。然后重新链接到/etc/alternatives/zabbix-web-font中即可。
删除原先字体的软连接,并把下载好的字体链接到/etc/alternatives/zabbix-web-font
[root@centos7 ~]# rm /etc/alternatives/zabbix-web-font
rm:是否删除符号链接 "/etc/alternatives/zabbix-web-font"?y
[root@centos7 ~]# ln -sv /usr/share/fonts/dejavu/simkai.ttf /etc/alternatives/zabbix-web-font
"/etc/alternatives/zabbix-web-font" -> "/usr/share/fonts/dejavu/simkai.ttf"
查看是否正确链接
[root@centos7 ~]# ll /etc/alternatives/zabbix-web-font
lrwxrwxrwx 1 root root 34 12月 20 09:06 /etc/alternatives/zabbix-web-font -> /usr/share/fonts/dejavu/simkai.ttf
3、不需要重启zabbix-server,刷新页面,可以看到已经正确显示中文。