centos7 cacti之weathmap中lable中文乱码问题

首先说明下:要想显示中文,本地的字段里面必需要有中文字体,新装的linux没有安装字段库,和相应的字体。下面以msyh.ttf字体为例来讲明。
一、fc-list查看字体库
二、yum -y install fontconfig安装
三、安装好后/usr/share目录下多两个目录fonts和fontconfigphp

四、首先在/usr/shared/fonts目录下新建一个目录chinesenode

这里貌似只支持msyh.ttf字体,拷贝其余字体没成功,也许哪会脸黑。
五、到C:\Windows\Fonts目录下上传你须要的字体到/usr/shared/fonts/chinese目录下linux

六、修改chinese权限:chmod -R 755 /usr/share/fonts/chinesecentos

七、接下来须要安装ttmkfdir来搜索目录中全部的字体信息,并汇总生成fonts.scale文件,
输入命令:yum -y install ttmkfdir编辑器

其实这步作不作都OK得,本身能够多尝试看下,我本身是没成功
八、最后一步就是修改字体配置文件了,首先经过编辑器打开配置文件:ide

vi /etc/fonts/fonts.conf测试

<!-- Font directory list -->
<dir>/usr/share/fonts</dir>
<dir>/usr/share/X11/fonts/Type1</dir> <dir>/usr/share/X11/fonts/TTF</dir> <dir>/usr/local/share/fonts</dir>
<dir prefix="xdg">fonts</dir>
<dir>/usr/share/fonts/chinese<dir> <!-- 这里是重点 -->
<!-- the following element will be removed in the future -->
<dir>~/.fonts</dir>字体

九、fc-cache刷新centos7

十、fc-list能够看到刚刚的配置了
————————————————element

进入到weathmap的configs下修改对应的文件,和字体所在路径一致便可

配置文件设置:
#Automatically generated by php-weathermap v0.98a
FONTDEFINE 100 /usr/share/fonts/chinese/msyh.ttf 10
#End of global section

#TEMPLATE-only NODEs:
NODE DEFAULT
LABELFONT 100 #这里的定义字体必需要写的,否则仍是乱码
MAXVALUE 100
#TEMPLATE-only LINKs:

#regular NODEs:
NODE node07372
LABEL 测试
POSITION 360 131

#regular LINKs:

#That's All Folks!

经过网页进入cacti,修改相应的路径。
centos7 cacti之weathmap中lable中文乱码问题centos7 cacti之weathmap中lable中文乱码问题

相关文章
相关标签/搜索