解决 zabbix-server Web页面中文乱码问题

centos

yum install -y wqy-microhei-fonts
\cp -f /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf

ubuntu

1. 安装中文字体

安装 fonts-wqy-microhei(文泉驿微米黑)

sudo apt update
sudo apt install fonts-wqy-microhei

验证字体是否安装成功

fc-list | grep "WenQuanYi Micro Hei"

应输出类似:

/usr/share/fonts/wqy-microhei/wqy-microhei.ttc: WenQuanYi Micro Hei,文泉驛微米黑:style=Regular
2. 修改 Zabbix 字体配置

找到 Zabbix 字体目录
Zabbix 默认使用 graphfont.ttf,需替换为中文兼容字体:

# 进入 Zabbix 前端字体目录
cd /usr/share/zabbix/assets/fonts/

# 备份原字体
sudo mv graphfont.ttf graphfont.ttf.bak

# 创建软链接到中文字体   具体wqy-microhei.ttc路径可以使用find寻找,find / -name  "wqy-microhei.ttc"
ln -s /usr/share/fonts/truetype/wqy/wqy-microhei.ttc graphfont.ttf 
# sudo ln -s /usr/share/fonts/wqy-microhei/wqy-microhei.ttc graphfont.ttf

参考文章

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐