zabbix解决中文乱码问题(没有测试成功)

时间:2022-10-04 06:06:59

zabbix解决中文乱码问题

1、在windows系统中找一个自己喜欢的字体,这里我们用:msyh.ttf

2、将字体上传至/var/www/html/zabbix/fonts目录下

[root@zabbix-server ~]# cd /var/www/html/zabbix/fonts/

[root@zabbix-server fonts]# rz -y
rz waiting to receive.
???a? zmodem ′???£ °′ Ctrl+C ???£
??′?? msyh.ttf...
100% 21257 KB 21257 KB/s 00:00:01 0 ′?

[root@zabbix-server fonts]# ll
总用量 21260
lrwxrwxrwx 1 root root 33 11月 20 08:53 graphfont.ttf -> /etc/alternatives/zabbix-web-font
-rw-r--r-- 1 root root 21767952 10月 31 11:31 msyh.ttf

3、修改zabbix页面管理的中文字体设置
[root@zabbix-server include]# cd /var/www/html/zabbix/include

#修改前先备份
[root@zabbix-server include]# cp defines.inc.php defines.inc.php.backup.linuge.2016-11-20

#修改代码
[root@zabbix-server include]# vi /var/www/html/zabbix/include/defines.inc.php #修改以下两行
define('ZBX_FONT_NAME', 'msyh');
define('ZBX_GRAPH_FONT_NAME', 'msyh');


[root@zabbix-server include]# /etc/init.d/httpd restart

停止 httpd:[确定]
正在启动 httpd:httpd: apr_sockaddr_info_get() failed for zabbix-server
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

[确定]

erron:

[root@zabbix-server ~]# cd /etc/httpd/conf

[root@zabbix-server conf]# cp httpd.conf httpd.conf.backup

[root@zabbix-server conf]# ll
总用量 88
-rw-r--r-- 1 root root 34419 7月 12 19:00 httpd.conf
-rw-r--r-- 1 root root 34419 11月 20 17:34 httpd.conf.backup
-rw-r--r-- 1 root root 13139 7月 18 23:24 magic

[root@zabbix-server conf]# vi httpd.conf

#ServerName www.example.com:80
ServerName 127.0.0.1:80     #增加一行写上这行参数

#再重启httpd服务,就解决啦!

[root@zabbix-server conf]# /etc/init.d/httpd restart
停止 httpd:[确定]
正在启动 httpd:[确定]


#重启相关服务
[root@zabbix-server include]# /etc/init.d/zabbix-server restart
Shutting down Zabbix server: [确定]
Starting Zabbix server: [确定]

#这步可以不操作
[root@zabbix-server include]# /etc/init.d/zabbix-agent restart
Shutting down Zabbix agent: [确定]
Starting Zabbix agent: [确定]

#访问网站
http://192.168.30.132/zabbix/index.php