操作系统:CentOS 9
Zabbix版本:Zabbix7.2
问题描述:主机图形中文字符乱码
解决方案:
安装字体配置和中文语言包
sudo yum install -y fontconfig langpacks-zh_CN.noarch
检查是否已有中文字体:
fc-list :lang=zh
[root@xla001 alternatives]# fc-list :lang=zh
/usr/share/fonts/google-noto-cjk/NotoSansCJK-DemiLight.ttc: Noto Sans CJK TC,Noto Sans CJK TC DemiLight:style=DemiLight,Regular
/usr/share/fonts/google-noto-cjk/NotoSerifCJK-Black.ttc: Noto Serif CJK SC,Noto Serif CJK SC Black:style=Black,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Light.ttc: Noto Sans CJK SC,Noto Sans CJK SC Light:style=Light,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Black.ttc: Noto Sans CJK SC,Noto Sans CJK SC Black:style=Black,Regular
/usr/share/fonts/google-noto-cjk/NotoSansCJK-Thin.ttc: Noto Sans CJK SC,Noto Sans CJK SC Thin:style=Thin,Regular
我们将google-noto-cjk/NotoSansCJK-DemiLight.ttc直接使用,将zabbix-web-ui 重命名
mv /etc/alternatives/zabbix-web-ui-font /etc/alternatives/zabbix-web-ui-font.bak
ln -sf重新创建软链接
ln -fs /usr/share/fonts/google-noto-cjk/NotoSansCJK-DemiLight.ttc /etc/alternatives/zabbix-web-font
ln -fs /usr/share/fonts/google-noto-cjk/NotoSansCJK-DemiLight.ttc /etc/alternatives/zabbix-web-ui-font