[Zabbix]
・グラフの日本語が文字化けを対処
- 日本語フォントのインストール
$ sudo aptitude install otf-ipafont
> Unpacking otf-ipafont-gothic (from .../otf-ipafont-gothic_00302-10_all.deb) ...
> Selecting previously deselected package otf-ipafont-mincho.
> Unpacking otf-ipafont-mincho (from .../otf-ipafont-mincho_00302-10_all.deb) ...
> Selecting previously deselected package otf-ipafont.
> Unpacking otf-ipafont (from .../otf-ipafont_00302-10_all.deb) ...
> Setting up otf-ipafont-gothic (00302-10) ...
> update-alternatives: using /usr/share/fonts/opentype/ipafont/ipag.ttf to provide /usr/share/fonts/truetype/ttf-japanese-gothic.ttf (ttf-japanese-gothic.ttf) in auto mode.
> Setting up otf-ipafont-mincho (00302-10) ...
> update-alternatives: using /usr/share/fonts/opentype/ipafont/ipam.ttf to provide /usr/share/fonts/truetype/ttf-japanese-mincho.ttf (ttf-japanese-mincho.ttf) in auto mode.
> Setting up otf-ipafont (00302-10) ...
> [master a7bc0e5] committing changes in /etc after apt run
> Author: ubuntu <ubuntu@ip-172-31-27-207.localdomain>
> 2 files changed, 2 insertions(+), 0 deletions(-)
> create mode 120000 alternatives/ttf-japanese-gothic.ttf
> create mode 120000 alternatives/ttf-japanese-mincho.ttf
⇒もともと日本語フォントはあったぽい
> /usr/share/fonts/opentype/ipafont/ipag.ttf ※ゴシック?
> /usr/share/fonts/opentype/ipafont/ipagp.ttf ※ゴシックプロポーショナル?
> /usr/share/fonts/opentype/ipafont/ipam.ttf ※明朝?
> /usr/share/fonts/opentype/ipafont/ipamp.ttf ※明朝プロポーショナル?
⇒今回インストールされたのは、
> /usr/share/fonts/truetype/ttf-japanese-gothic.ttf -> /etc/alternatives/ttf-japanese-gothic.ttf
> /usr/share/fonts/truetype/ttf-japanese-mincho.ttf -> /etc/alternatives/ttf-japanese-mincho.ttf
- zabbixのフォルダにリンクを貼る
$ sudo ln -s /usr/share/fonts/truetype/ttf-japanese-gothic.ttf /usr/share/zabbix/fonts/
- zabbixがグラフに使用するフォントを変更
$ sudo nano /usr/share/zabbix/include/defines.inc.php
(変更前) > define('ZBX_GRAPH_FONT_NAME', 'DejaVuSans')
(変更後) > define('ZBX_GRAPH_FONT_NAME', 'ipag');
⇒日本語が表示された!
0 件のコメント:
コメントを投稿