- 追加された行はこの色です。
- 削除された行はこの色です。
目次
#contents
**マップの文字化け対策 [#m6b5895b]
**修正手順[#m6b5895b]
初期状態ではユーザの言語を日本語に変更するとマップで文字化けが発生する。~
正常に日本語を表示するには日本語フォントを準備し、map.phpを修正する必要がある。~
-日本語フォント取得(SAZANAMIフォント)
wget http://globalbase.dl.sourceforge.jp/efont/10087/sazanami-20040629.tar.bz2
bzip2 -d sazanami-20040629.tar.bz2
tar xfv sazanami-20040629.tar
cd sazanami-20040629
cp sazanami-* /usr/share/fonts/
/usr/share/fonts配下に日本語フォントがインストールされる。
***ZABBIX 1.4系 [#of4eb820]
-map.phpの修正~
260行目を以下のように変更。~
-変更前~
ImageString($im, 2, $x_info, $y_info, $info_line,$color);
-変更後~
//ImageString($im, 2, $x_info, $y_info, $info_line,$color);
ImageTTFText($im, 8, 0, $x_info+5, $y_info+10, $color, "/usr/share/fonts/sazanami-gothic.ttf", $info_line);
***ZABBIX 1.6系 [#a02a5487]
-map.phpの修正~
1.6系からは文字列が小文字になったため、以下の行で検索する。
-変更前~
imagestring($im, 2, $x_info, $y_info, $info_line,$color);
-変更後~
//imagestring($im, 2, $x_info, $y_info, $info_line,$color);
ImageTTFText($im, 8, 0, $x_info+5, $y_info+10, $color, "/usr/share/fonts/sazanami-gothic.ttf", $info_line);
***ZABBIX 1.8系、2.0系 [#ld74133a]
1.8系からはフロントエンド内にフォントを保管する領域が準備されているため、これを使用する。~
sazanami-gothic.ttf(/usr/share/fonts/japanese/TrueType/sazanami-gothic.ttf)を使用するためには、この既定フォルダ内にシンボリックリンクを生成し、./include/defines.inc.phpにフォント名を指定する。~
-手順(さざなみフォント)
cd ./fonts
ln -s /usr/share/fonts/japanese/TrueType/sazanami-gothic.ttf sazanami-gothic.ttf
cd ../
vi ./include/defines.inc.php
-変更前(defines.inc.php)
define('ZBX_GRAPH_FONT_NAME', 'DejaVuSans');
~
-変更後(defines.inc.php)
define('ZBX_GRAPH_FONT_NAME', 'sazanami-gothic');
最近のLinuxではIPAのフォントが搭載されているため、こちらの方が綺麗に描画することができる。~
さざなみフォントではグラフのメモリが潰れてしまうため、IPAゴシックが推奨。~
-手順(IPAフォント)
cd ./fonts
ln -s /usr/share/fonts/ipa-gothic/ipag.ttf ipag.ttf
cd ../
vi ./include/defines.inc.php
-変更前(defines.inc.php)
define('ZBX_GRAPH_FONT_NAME', 'DejaVuSans');
~
-変更後(defines.inc.php)
define('ZBX_GRAPH_FONT_NAME', 'ipag.ttf');