OCS Inventory NG、GLPI導入・日本語対策方法
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*2009年8月15日 @ 19:11時点の記事です。 [#odd75d2b]
パソコンがいっぱいで何が入ってるのかわからないので、会社...
QNDは有償なのでフリーでないかと探したところ、OCS Inventor...
OCS Inventory NG・・・デフォルトで日本語対応していないが...
Windows日本語版から資産を登録しようとすると日本語が文字化...
GLPI・・・デフォルトで日本語対応しているが、エージェント...
インストールはすぐできるので、後日記載。 ~
OCS Inventory NGで、Windows日本語版から資産を登録しようと...
忘れると色々と面倒くさいので、今のうちに記載しておく。 ~
~
(1)OCS Inventory NGの修正(元:http://forums.ocsinvent...
/usr/lib/perl5/site_perl/5.8.8/Apache/Ocsinventory.pm
----------------------------------------------------------
if(!$inflated){
&_log(506,'handler','Compress stage');
return &_end(APACHE_SERVER_ERROR);
}
}
$CURRENT_CONTEXT{'DATA'} = \$inflated;
###追加開始############################
use Encode;
$inflated =~ s/encoding="ISO-8859-1"/encoding="Shift-JIS...
Encode::from_to($inflated,'shiftjis','euc-jp');
Encode::from_to($inflated,'euc-jp','shiftjis');
###追加終了############################
##########################
# Parse the XML request
# Retrieving xml parsing options if needed &_get_xml_par...
~
(2)shift_jis対応(元:http://homepage3.nifty.com/hippo...
・wgetでhttp://homepage3.nifty.com/hippo2000/perltips/xm...
・圧縮ファイル内のEncoding/mkenc内のmkenc.plを/usr/lib/p...
・perl mvenc.pl x-sjis-cp932 shift-jisを実行する。
・[root@hanzou008 Encodings]# ls -ltr
合計 380
-rw-r--r-- 1 root root 18202 7月 27 2003 x-sjis-unicode....
-rw-r--r-- 1 root root 18202 7月 27 2003 x-sjis-jisx0221...
-rw-r--r-- 1 root root 18202 7月 27 2003 x-sjis-jdk117.enc
-rw-r--r-- 1 root root 20368 7月 27 2003 x-sjis-cp932.enc
-rw-r--r-- 1 root root 37890 7月 27 2003 x-euc-jp-unicod...
-rw-r--r-- 1 root root 37890 7月 27 2003 x-euc-jp-jisx02...
-rw-r--r-- 1 root root 1072 7月 27 2003 windows-1250.enc
-rw-r--r-- 1 root root 1072 7月 27 2003 iso-8859-9.enc
-rw-r--r-- 1 root root 1072 7月 27 2003 iso-8859-8.enc
-rw-r--r-- 1 root root 1072 7月 27 2003 iso-8859-7.enc
-rw-r--r-- 1 root root 1072 7月 27 2003 iso-8859-5.enc
-rw-r--r-- 1 root root 1072 7月 27 2003 iso-8859-4.enc
-rw-r--r-- 1 root root 1072 7月 27 2003 iso-8859-3.enc
-rw-r--r-- 1 root root 1072 7月 27 2003 iso-8859-2.enc
-rw-r--r-- 1 root root 45802 7月 27 2003 euc-kr.enc
-rw-r--r-- 1 root root 40706 7月 27 2003 big5.enc
-rw-r--r-- 1 root root 1946 7月 27 2003 README
-rw-r--r-- 1 root root 4821 7月 27 2003 Japanese_Encodin...
-rw-r--r-- 1 root root 1072 7月 27 2003 windows-1252.enc
-rw-r--r-- 1 root root 1352 8月 15 18:18 mkenc.pl
-rw-r--r-- 1 root root 20368 8月 15 18:20 shift-jis.enc
(3)エージェントインストール済のWindows端末から
"C:\Program Files\OCS Inventory Agent\ocsinventory.exe" ...
これで文字化けせずに格納される。
*(2009/08/15 20:52 以下追記) [#e1ed2ee7]
GLPIへ連携したとき、文字化けを起こすので次の対策を行う。
+glpiインストールディレクトリ/inc配下のocsng.class.phpを...
--------------------------------------------------------...
if ($CFG_GLPI["ocs_mode"])
{
$data = getOcsConf($ID);
$this->dbhost = $data["ocs_db_host"];
$this->dbuser = $data["ocs_db_user"];
$this->dbpassword = rawurldecode($data["ocs_db_passwd"...
$this->dbdefault = $data["ocs_db_name"];
$this->dbenc="UTF-8";
parent::__construct();
}
--------------------------------------------------------...
~
+ソフトウェアの文字化けを直す。&br;glpiインストールディレ...
--------------------------------------------------------...
function connect(){
$this->connected=false;
$this->dbh = @mysql_connect($this->dbhost, $this->dbus...
if ($this->dbh){
// connexion ok
@mysql_query("SET NAMES '" . (isset($this->dbenc) ? ...
$select= mysql_select_db($this->dbdefault) or $this-...
if ($select){
// select ok
$this->connected=true;
}else{
// select wrong $this->connected=false;
}
} else {
// connexion wrong $this->connected=false;
}
}
--------------------------------------------------------...
※"utf8"で直す、と記載しているサイトがあるが、ダメ(文字...
終了行:
*2009年8月15日 @ 19:11時点の記事です。 [#odd75d2b]
パソコンがいっぱいで何が入ってるのかわからないので、会社...
QNDは有償なのでフリーでないかと探したところ、OCS Inventor...
OCS Inventory NG・・・デフォルトで日本語対応していないが...
Windows日本語版から資産を登録しようとすると日本語が文字化...
GLPI・・・デフォルトで日本語対応しているが、エージェント...
インストールはすぐできるので、後日記載。 ~
OCS Inventory NGで、Windows日本語版から資産を登録しようと...
忘れると色々と面倒くさいので、今のうちに記載しておく。 ~
~
(1)OCS Inventory NGの修正(元:http://forums.ocsinvent...
/usr/lib/perl5/site_perl/5.8.8/Apache/Ocsinventory.pm
----------------------------------------------------------
if(!$inflated){
&_log(506,'handler','Compress stage');
return &_end(APACHE_SERVER_ERROR);
}
}
$CURRENT_CONTEXT{'DATA'} = \$inflated;
###追加開始############################
use Encode;
$inflated =~ s/encoding="ISO-8859-1"/encoding="Shift-JIS...
Encode::from_to($inflated,'shiftjis','euc-jp');
Encode::from_to($inflated,'euc-jp','shiftjis');
###追加終了############################
##########################
# Parse the XML request
# Retrieving xml parsing options if needed &_get_xml_par...
~
(2)shift_jis対応(元:http://homepage3.nifty.com/hippo...
・wgetでhttp://homepage3.nifty.com/hippo2000/perltips/xm...
・圧縮ファイル内のEncoding/mkenc内のmkenc.plを/usr/lib/p...
・perl mvenc.pl x-sjis-cp932 shift-jisを実行する。
・[root@hanzou008 Encodings]# ls -ltr
合計 380
-rw-r--r-- 1 root root 18202 7月 27 2003 x-sjis-unicode....
-rw-r--r-- 1 root root 18202 7月 27 2003 x-sjis-jisx0221...
-rw-r--r-- 1 root root 18202 7月 27 2003 x-sjis-jdk117.enc
-rw-r--r-- 1 root root 20368 7月 27 2003 x-sjis-cp932.enc
-rw-r--r-- 1 root root 37890 7月 27 2003 x-euc-jp-unicod...
-rw-r--r-- 1 root root 37890 7月 27 2003 x-euc-jp-jisx02...
-rw-r--r-- 1 root root 1072 7月 27 2003 windows-1250.enc
-rw-r--r-- 1 root root 1072 7月 27 2003 iso-8859-9.enc
-rw-r--r-- 1 root root 1072 7月 27 2003 iso-8859-8.enc
-rw-r--r-- 1 root root 1072 7月 27 2003 iso-8859-7.enc
-rw-r--r-- 1 root root 1072 7月 27 2003 iso-8859-5.enc
-rw-r--r-- 1 root root 1072 7月 27 2003 iso-8859-4.enc
-rw-r--r-- 1 root root 1072 7月 27 2003 iso-8859-3.enc
-rw-r--r-- 1 root root 1072 7月 27 2003 iso-8859-2.enc
-rw-r--r-- 1 root root 45802 7月 27 2003 euc-kr.enc
-rw-r--r-- 1 root root 40706 7月 27 2003 big5.enc
-rw-r--r-- 1 root root 1946 7月 27 2003 README
-rw-r--r-- 1 root root 4821 7月 27 2003 Japanese_Encodin...
-rw-r--r-- 1 root root 1072 7月 27 2003 windows-1252.enc
-rw-r--r-- 1 root root 1352 8月 15 18:18 mkenc.pl
-rw-r--r-- 1 root root 20368 8月 15 18:20 shift-jis.enc
(3)エージェントインストール済のWindows端末から
"C:\Program Files\OCS Inventory Agent\ocsinventory.exe" ...
これで文字化けせずに格納される。
*(2009/08/15 20:52 以下追記) [#e1ed2ee7]
GLPIへ連携したとき、文字化けを起こすので次の対策を行う。
+glpiインストールディレクトリ/inc配下のocsng.class.phpを...
--------------------------------------------------------...
if ($CFG_GLPI["ocs_mode"])
{
$data = getOcsConf($ID);
$this->dbhost = $data["ocs_db_host"];
$this->dbuser = $data["ocs_db_user"];
$this->dbpassword = rawurldecode($data["ocs_db_passwd"...
$this->dbdefault = $data["ocs_db_name"];
$this->dbenc="UTF-8";
parent::__construct();
}
--------------------------------------------------------...
~
+ソフトウェアの文字化けを直す。&br;glpiインストールディレ...
--------------------------------------------------------...
function connect(){
$this->connected=false;
$this->dbh = @mysql_connect($this->dbhost, $this->dbus...
if ($this->dbh){
// connexion ok
@mysql_query("SET NAMES '" . (isset($this->dbenc) ? ...
$select= mysql_select_db($this->dbdefault) or $this-...
if ($select){
// select ok
$this->connected=true;
}else{
// select wrong $this->connected=false;
}
} else {
// connexion wrong $this->connected=false;
}
}
--------------------------------------------------------...
※"utf8"で直す、と記載しているサイトがあるが、ダメ(文字...
ページ名: