Cacti Chinese garbled and cacti generated pictures garbled

Source: Internet
Author: User
Tags rrdtool

For the newly installed cacti, in order to detect the accuracy of the monitoring data, as well as with the rrdtool generated by the statistical map to the official show so beautiful, can not wait to click on the tab in the image of a column. The results of the following situation, that is, cacti generation with Chinese pictures have garbled. The RRDtool I installed is the 1.4.5 version.

In order to solve this problem, the Internet to check a pass.

RRDtool 1.4.5 Map Support Chinese method:
finally to solve, in fact, is rrdtool tool can not recognize Chinese. Because viewing RRDtool compiled source code, the default encoding is indeed empty ("C"). You can open the Src/rrd_graph.c file in the RRDtool folder. In line 3496:

The code is as follows Copy Code
SetLocale (Lc_all, "C");

The default is null, and you can manually modify it directly to:

The code is as follows Copy Code
SetLocale (Lc_all, "zh_cn.gb2312");

or use it in the RRDtool installation directory:

The code is as follows Copy Code
Sed-i ' S/setlocale (lc_numeric, "C")/setlocale (Lc_all, "zh_cn.gb2312")/g ' src/rrd_graph.c

Both of these modification methods are OK. is to convert setlocale (lc_numeric, "C") to SetLocale (Lc_all, "Zh_cn.gb2312″").

The code is as follows Copy Code
<span style= "LINE-HEIGHT:18PX;" >make </span>
<span style= "LINE-HEIGHT:18PX;" > </span>
<span style= "LINE-HEIGHT:18PX;" >MV./src/rrdtool/usr/local/rrdtool/bin/rrdtool </span>

 
Then copy the C:/WINDOWS/FONTS/SIMSUN.TTC in WINDOWS to the/usr/share/fonts/chinese/truetype/directory, and RRDtool can support Chinese.
 
CP C:/WINDOWS/FONTS/SIMSUN.TTC c:/ 
then go to/usr/share/fonts/chinese/truetype/in your own way.
then modify the cacti configuration file, set = "Path =" RRDtool default font path:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.