[SOLVED] Cacti 0.8.7g+RRDTool 1.4.3+ru_RU.UTF8 => Cyrillic
Moderators: Developers, Moderators
[SOLVED] Cacti 0.8.7g+RRDTool 1.4.3+ru_RU.UTF8 => Cyrillic
Could anyone help me with drawing graphs, using Cyrillic letters? I have Cacti 0.8.7g, running on Ubuntu 10.04.2 LTE server, with RRDTool 1.4.3 and locale ru_RU.UTF-8. Cacti Database uses UTF-8 charset.
When I name graphs with Cyrillic characters it does not store any characters. Only Latin characters are stored. Therefore there are no Cyrillic characters in Cacti management console, nor in the graphs. I found one topic here with similar problem while upgrading from RRDTool 1.2.x to 1.3.x, but there were boxes instead of letters. I do not get neither boxes, nor any other letters, and I did not use older version of RRDTool before.
Is there any solution?
PS: I am sorry for 2 duplicate posts before this one
When I name graphs with Cyrillic characters it does not store any characters. Only Latin characters are stored. Therefore there are no Cyrillic characters in Cacti management console, nor in the graphs. I found one topic here with similar problem while upgrading from RRDTool 1.2.x to 1.3.x, but there were boxes instead of letters. I do not get neither boxes, nor any other letters, and I did not use older version of RRDTool before.
Is there any solution?
PS: I am sorry for 2 duplicate posts before this one
Last edited by cepxuo on Mon Mar 07, 2011 10:37 am, edited 1 time in total.
Re: Cacti 0.8.7g + RRDTool 1.4.3 + ru_RU.UTF8 => Cyrillic gr
Can you use Cyrillic characters for graph title when using rrdtool only?
To verify, try this code and look title of 'test.png':(Fit "cacti/rra/localhost_cpu_system_XXX.rrd' to your environment)
If you have your own Cyrillic font, check whether your font exists or not in output of 'fc-list' command:
(see font-config manual)then modify to
If rrdtool worked fine, then try modifications mentioned the topic [ Cacti russian charset description to host ].
(Maybe it need to change 'include/top_header.php' and 'include/top_graph_header.php' only?)
Note: 'Content-Type' in <meta> tag settings seems to be implemented in 0.8.8...
To verify, try this code and look title of 'test.png':
Code: Select all
#!/bin/sh
rrdtool graph test.png \
--imgformat=PNG \
--title='((Title with Cyrillic characters))' \
--font TITLE:12: \
DEF:a="cacti/rra/localhost_cpu_system_XXX.rrd":cpu_system:AVERAGE \
AREA:a#FF0000FF:"System"
If you have your own Cyrillic font, check whether your font exists or not in output of 'fc-list' command:
(see font-config manual)
Code: Select all
% fc-list :lang=ru
FreeSans:style=Bold,polkrepko
FreeMono:style=Bold,Negreta,tun,fed,Fett,ντονα,Negrita,Lihavoitu,Gras,Flkvr,Grassetto,Vet,Halvfet,Pogrubiony,Negrito,Полужирный,Fet,Kaln,polkrepko,m,Lodia
...
Code: Select all
--font TITLE:12: \
Code: Select all
--font TITLE:12:FreeMono(or your font) \
(Maybe it need to change 'include/top_header.php' and 'include/top_graph_header.php' only?)
Note: 'Content-Type' in <meta> tag settings seems to be implemented in 0.8.8...
Re: Cacti 0.8.7g + RRDTool 1.4.3 + ru_RU.UTF8 => Cyrillic gr
The magic worked!!! Thank you very much!!!!noname wrote:If rrdtool worked fine, then try modifications mentioned the topic [ Cacti russian charset description to host ].
(Maybe it need to change 'include/top_header.php' and 'include/top_graph_header.php' only?)
Re: [SOLVED] Cacti 0.8.7g+RRDTool 1.4.3+ru_RU.UTF8 => Cyrill
I'm glad to hear that.
I'm also using this way to show Japanese characters.
I'm also using this way to show Japanese characters.
Re: [SOLVED] Cacti 0.8.7g+RRDTool 1.4.3+ru_RU.UTF8 => Cyrill
Unfortunately it worked in a half. Now I see Cyrillic in Cacti console. But There are still empty spaces in graphsnoname wrote:I'm glad to hear that.
I'm also using this way to show Japanese characters.
Your script worked OK. I mean RRDTool shows Cyrillic when it is called directly. What else should I modify?
Re: [SOLVED] Cacti 0.8.7g+RRDTool 1.4.3+ru_RU.UTF8 => Cyrill
Oh, sadly.
Did you specify the default font in 'Console -> Settings-> Visual' tab?
Did you specify the default font in 'Console -> Settings-> Visual' tab?
Re: [SOLVED] Cacti 0.8.7g+RRDTool 1.4.3+ru_RU.UTF8 => Cyrill
Yes I did, and also in Console->Paths->RRDTool Default Fontnoname wrote:Oh, sadly.
Did you specify the default font in 'Console -> Settings-> Visual' tab?
It looks like the values are passed to RRDTool with wrong encoding, while drawing graphs:
Code: Select all
03/07/2011 10:59:08 PM - WEBLOG: Poller[0] CACTI2RRD: /usr/bin/rrdtool graph - --imgformat=PNG --start=-86400 --end=-300 --title=' - /' --rigid --base=1024 --height=120 --width=600 --alt-autoscale-max --lower-limit=0 --vertical-label='' --slope-mode --font TITLE:10: --font AXIS:8: --font LEGEND:9: --font UNIT:8: DEF:a="/var/lib/cacti/rra/1/137.rrd":hdd_total:AVERAGE DEF:b="/var/lib/cacti/rra/1/137.rrd": GPRINT:a:LAST:"" GPRINT:a:AVERAGE:"" GPRINT:a:MAX:"" AREA:b#F51D30FF:"" GPRINT:b:LAST:"" GPRINT:b:AVERAGE:"" GPRINT:b:MAX:"" VRULE:1299438000#FF0000FF:""
The values are empty
Also I tried to change manually (via phpmyadmin) values in cacti database (table graph_template_item) and now I see Cyrillic in legend of the graph. But still nothing in the title.
So I guess Cacti still does not "understand" cyrillic and does not pass it to RRDTool nor MySQL,
Re: [SOLVED] Cacti 0.8.7g+RRDTool 1.4.3+ru_RU.UTF8 => Cyrill
Okay..
Then, try this.
(1) Test behavior of escapeshellarg()
At function cacti_escapeshellarg() within 'lib/functions.php':
changeto
If graph title shows Cyrillic characters, it seems be problem of locale settings,
like as this. (but that's not bug)
Then, proceed to (2).
(Please don't forget to revert the above change)
(2) Set default locale in your PHP or Apache or Server
Try one (or all) of the below:
[A] PHP settings
In php.ini:* old version of PHP had problems for russian encoding
Apache start-up script
In '/etc/init.d/httpd' (or else):
changeto (or add)
[C] Server settings
In '/etc/sysconfig/i18n' (or other system-wide settings):
change or add
Good luck.
If all failed, I can't imagine any more.. sorry.
Then, try this.
(1) Test behavior of escapeshellarg()
At function cacti_escapeshellarg() within 'lib/functions.php':
change
Code: Select all
$string = escapeshellarg($string);
Code: Select all
# $string = escapeshellarg($string);
like as this. (but that's not bug)
Then, proceed to (2).
(Please don't forget to revert the above change)
(2) Set default locale in your PHP or Apache or Server
Try one (or all) of the below:
[A] PHP settings
In php.ini:
Code: Select all
default_charset = UTF-8
mbstring.language = Windows-1251 (or else)
mbstring.encoding_translation = On
mbstring.internal_encoding = UTF-8
Apache start-up script
In '/etc/init.d/httpd' (or else):
change
Code: Select all
HTTPD_LANG=${HTTPD_LANG-"C"}
Code: Select all
HTTPD_LANG=${HTTPD_LANG-"ru_RU.UTF8"}
In '/etc/sysconfig/i18n' (or other system-wide settings):
change or add
Code: Select all
LANG=ru_RU.UTF8
If all failed, I can't imagine any more.. sorry.
Re: [SOLVED] Cacti 0.8.7g+RRDTool 1.4.3+ru_RU.UTF8 => Cyrill
Thank you once again. Now everything works fine. I did what you said, and some more:
1) I have 2 php.ini files: one in /etc/php5/apache2 and another is in /etc/php5/cli. I added changes to both files.
2) I made changes to /etc/init.d/apache2 file as you said
3) I did not find i18n file in /etc but I chenged the following in /etc/apache2/envvars:
to
4) I uncommented the line in /etc/apache2/conf.d/charset
And now everything works fine!
1) I have 2 php.ini files: one in /etc/php5/apache2 and another is in /etc/php5/cli. I added changes to both files.
2) I made changes to /etc/init.d/apache2 file as you said
3) I did not find i18n file in /etc but I chenged the following in /etc/apache2/envvars:
Code: Select all
export LANG=C
Code: Select all
export LANG=ru_RU.UTF8
Code: Select all
AddDefaultCharset UTF-8
Who is online
Users browsing this forum: No registered users and 2 guests