Ubuntu Server 20.04 zabbix5.0 服务端中文乱码

参考资料:


  1. 安装文档:https://www.zabbix.com/cn/download?zabbix=5.0&os_distribution=ubuntu&os_version=20.04_focal&db=mysql&ws=apache

  2. 中文手册:https://www.zabbix.com/documentation/5.0/zh/manual


修改服务配置

vim /etc/zabbix/zabbix_server.conf
# 设置数据库连接密码
DBPassword=password
# 设置发现线程数,默认1,解决:Zabbix server: Utilization of discoverer processes over 75%
StartDiscoverers=5

设置Apache首页为zabbix

vim /etc/apache2/sites-available/000-default.conf
# 修改根目录指向zabbix
DocumentRoot /usr/share/zabbix
# 默认初始管理员:Admin 密码:zabbix

配置中文支持

# 查看当前语言
locale -a
# 如果没有zh_CN.utf8则需要安装语言
apt install language-pack-zh-hans
# 登录Web界面,在User settings中更改语言

解决中文图表乱码

# 下载中文字体,也可以上传自定义中文字体
wget https://mirrors.tuna.tsinghua.edu.cn/adobe-fonts/source-han-sans/Variable/TTF/Subset/SourceHanSansCN-VF.ttf
# 将ttf字体放到/usr/share/fonts/truetype/
mv SourceHanSansCN-VF.ttf /usr/share/fonts/truetype/

# zabbix 默认字体graphfont.ttf 位置:/usr/share/zabbix/assets/fonts/
# 查看web字体发现graphfont.ttf是软连接,依次查找字体文件

ll /usr/share/zabbix/assets/fonts/
# graphfont.ttf -> /etc/alternatives/zabbix-frontend-font

ll /etc/alternatives/zabbix-frontend-font
# /etc/alternatives/zabbix-frontend-font -> /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
# 删除原连接,并重新将连接指向中文字体
rm /etc/alternatives/zabbix-frontend-font
ln -s /usr/share/fonts/truetype/SourceHanSansCN-VF.ttf /etc/alternatives/zabbix-frontend-font
# /etc/alternatives/zabbix-frontend-font -> /usr/share/fonts/truetype/SourceHanSansCN-VF.ttf
# 重启服务
systemctl restart zabbix-server apache2
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章