Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The solution to the problem of Chinese garbled code and statistical graph garbled in Cacti RRDTOOL

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Today, I will talk to you about the solutions to the problem of Chinese garbled codes and statistical charts in Cacti RRDTOOL. Many people may not know much about it. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.

The rrdtool I installed is version 1.4.5. In order to solve this problem, I looked it up on the Internet.

Rrdtool 1.4.5 drawing supports Chinese methods:

In the end, it was solved that the RRDTOOL tool could not recognize Chinese. Because looking at the source code compiled by rrdtool, the default code is indeed empty ("C"). You can open the src/rrd_graph.c file in the rrdtool folder. On line 3496:

The code is as follows:

Setlocale (LC_ALL, "C")

The default is empty, and you can manually change it directly to:

The code is as follows:

Setlocale (LC_ALL, "zh_CN.gb2312")

Or use the following in the rrdtool installation directory:

The code is as follows:

Sed-I 's/setlocale (LC_NUMERIC, "C") / setlocale (LC_ALL, "zh_CN.gb2312") / g' src/rrd_graph.c

Both methods of modification are fine. Is to change setlocale (LC_NUMERIC, "C") to setlocale (LC_ALL, "zh_CN.gb2312").

The code is as follows:

Make

Mv. / src/rrdtool / usr/local/rrdtool/bin/rrdtool

Then copy C:\ WINDOWS\ Fonts\ simsun.ttc in windows to the / usr/share/fonts/chinese/TrueType/ directory, and rrdtool can support Chinese.

The code is as follows:

Cp C:\ WINDOWS\ Fonts\ simsun.ttc C:\

Then send it to / usr/share/fonts/chinese/TrueType/ in your own way.

Then modify the Cacti configuration file to set = "path =" RRDTool default font path:

Then you can see the non-garbled statistical chart shown below:

After reading the above, do you have any further understanding of the solution to the Cacti RRDTOOL Chinese garbled code and statistical graph garbled problem? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report