Zabbix Scheduled reports中文乱码

困扰了一天的问题,最后还是靠百度大神的方法解决。原文链接 https://blog.csdn.net/weixin_38587368/article/details/119357516

 

由于我的是容器环境,稍微有点不同。ps:下面命令似乎不好使,需要先进入到容器后执行 

 

一、允许yum东西

docker exec -u root -it zabbix-server sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
docker exec -u root -it zabbix-server sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
docker exec -u root -it zabbix-web-service sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
docker exec -u root -it zabbix-web-service sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

二、yum安装软件

docker exec -u root -it zabbix-server yum install langpacks-zh_CN.noarch fontconfig ttmkfdir -y
docker exec -u root -it zabbix-web-service yum install langpacks-zh_CN.noarch fontconfig ttmkfdir -y

三、创建字体文件夹

docker exec -u root -it zabbix-server mkdir /usr/share/fonts/chinese -p
docker exec -u root -it zabbix-server chmod -R 755 /usr/share/fonts/chinese
docker exec -u root -it zabbix-web-service mkdir /usr/share/fonts/chinese -p
docker exec -u root -it zabbix-web-service chmod -R 755 /usr/share/fonts/chinese

四、复制字体到容器内部

cd /www/zabbix
docker cp MSYH.TTF zabbix-server:/usr/share/fonts/chinese/
docker cp MSYH.TTF zabbix-web-service:/usr/share/fonts/chinese/

五、更新字体缓存

docker exec -u root -it zabbix-server ttmkfdir -e /usr/share/X11/fonts/encodings/encodings.dir
docker exec -u root -it zabbix-server fc-cache
docker exec -u root -it zabbix-server fc-list
docker exec -u root -it zabbix-web-service ttmkfdir -e /usr/share/X11/fonts/encodings/encodings.dir
docker exec -u root -it zabbix-web-service fc-cache
docker exec -u root -it zabbix-web-service fc-list

六、重启容器

docker restart zabbix-server
docker restart zabbix-web-service
posted @ 2022-07-06 01:02  一起走过的路  阅读(159)  评论(0编辑  收藏  举报