GlpiによるIT資産管理とocsinvetory-ngによるインベントリ情報収集 日本語対応とインストールと設定について ocsinventory-ng Open Computer and Software Inventory Next Generation glpi Free IT and asset management software 日本語対応パッチ入りのocsinventory-ngのportsです。ベースは1.02です。 ダウンロードはこちらから ports_ocsinventory-ng-1.02.tgz ports_ocsinventory-ng-1.02.1.tgz glpiは日本語対応がされていますので、ほぼ問題ありません。 ocsinventory-ngで日本語を扱えるようにするにはちょっとした変更が必要です。 上記ソフトウエアの実行するには apache,php,mysql,perlといったソフトウエアが必要です。 glpiのインストール前にインストールしておくべきソフトウエア 今回はmysql6.0を使ってみましたが、5.xでも4.xでも動作すると思います。 ■mysql60-serverのインストール時には make WITH_CHARSET=utf8 WITH_XCHARSET=all で標準の文字コードをuft8にしておく。
|
cd
/usr/ports/databases/mysql60-server セクション[client],[mysqld],[mysql]に |
mysqlのインストールが終わったら、すぐにデータベースにパスワードを設定しましょう。
|
mysql |
■php5のインストール /usr/ports/lang/php5をインストールします。 インストールが終わったら日本語に関する設定を追加します。
|
cd
/usr/ports/lang/php5 日本語に関する設定を追加します。 |
■mod_perl2 このmod_perl2をインストールし終わったら/etc/make.confに WITH_MODPERL2=yes の行を追加しておくこと、これを忘れるとglpiのインストール時にmod_perl1.3が使用されて悲しいことになる。 以下の二つもglpiのインストール前に、手動でいれておくこと。 ■p5-DBD-mysql60-4.010 ■php5-mysql-5.2.9 ■ ocsinventory-ngのインストール portsからocsinventory-ngをインストールすると、セットアップに必用なファイルが /usr/local/share/ocsinventory-ng にコピーされます。 /usr/local/share/ocsinventory-ng/setup.shを実行します。
|
cd
/usr/ports/net-mgnt/ocsinventory-ng cd
/usr/local/share/ocsinventory-ng |
上記setup.shの実行で/etc/logrotate.dが無いとエラーになります。
|
mkdir
/usr/local/etc/logrotate.d |
無いディレクトリは作ってやります。 上記のportsからインストールされるocsinventory-ngが1.01で少々古いことに気がついた。 現在は1.02が最新版 セットアップを実行して動作確認したところでocsinventory-ngをアンインストール。 http://sourceforge.net/project/downloading.php?group_id=58373&filename=OCSNG_UNIX_SERVER-1.02.tar.gz または、 http://jaist.dl.sourceforge.net/sourceforge/ocsinventory/OCSNG_UNIX_SERVER-1.02.tar.gz こちらを/usr/local/share/ocsinventory-ng/へ解凍する。 setup.shを実行。 データーベースがlatin1で作られてしまいました。 これではだめなのでデータベースocswebを一旦削除。 ここからocsinventory-ngの日本語対応。 まず国旗のjapanese.pngを用意。english.txtをjapanese.txtにコピー。 日本語化(UTF-8)対応の修正箇所がいっぱいあるのでパッチを用意しました。 おおまかな修正点
データベースをUTF8にすることでインデックスサイズが大きくなりすぎた。文字長を縮小。
アップロードされたインベントリ情報(xml)をSHIFT-JISからUTFに変換してデータベースに格納。
ocsreport画面での日本語化と文字化け対策。
ここからは、パッチ済みをソースでインストール パッチを含んだportsパッケージを用意しましたので、これを使ってください。 パッチ済みportsパッケージでmake ; make install した後のsetup.shの実行
|
# ./setup.sh +----------------------------------------------------------+ CAUTION: If upgrading
Communication server from OCS Inventory NG 1.0 RC2 and Do you wish to continue
([y]/n)? Starting OCS Inventory NG
Management server setup from folder
/usr/local/share/ocsinventory-ng +----------------------------------------------------------+ Your MySQL client seems to be
part of MySQL version 6.0. Which host is running database
server [localhost] ? On which port is running
database server [3306] ? +----------------------------------------------------------+ Where is Apache daemon binary
[/usr/local/sbin/httpd] ? +----------------------------------------------------------+ Where is Apache main
configuration file [/usr/local/etc/apache22/httpd.conf] ? +----------------------------------------------------------+ Which user account is running
Apache web server [User] ?www +----------------------------------------------------------+ Which user group is running
Apache web server [www] ? +----------------------------------------------------------+ Setup found Apache Include
configuration directory in. +----------------------------------------------------------+ Found PERL Intrepreter at
</usr/bin/perl> ;-) Do you wish to setup Communication server on this computer ([y]/n)? +----------------------------------------------------------+ OK, Make utility found at </usr/bin/make> ;-) +----------------------------------------------------------+ Checking for Apache mod_perl
version 1.99_22 or higher +----------------------------------------------------------+ Communication server can create
detailled logs. This logs can be enabled +----------------------------------------------------------+ Checking for DBI PERL
module... +----------------------------------------------------------+ Checking for SOAP::Lite PERL
module... +----------------------------------------------------------+ Writing Makefile for Apache::Ocsinventory +----------------------------------------------------------+ +----------------------------------------------------------+ +----------------------------------------------------------+ Creating Communication server log directory /var/log/ocsinventory-server. Fixing Communication server log
directory files permissions. +----------------------------------------------------------+ To ensure Apache loads mod_perl
before OCS Inventory NG Communication Server, +----------------------------------------------------------+ Do you wish to setup
Administration Server (Web Administration Console) +----------------------------------------------------------+ CAUTION: Setup now install
files in accordance with Filesystem Hierarchy Do you wish to continue
([y]/n)? Where to copy Administration
Server static files for PHP Web
Console +----------------------------------------------------------+ Checking for DBI PERL
module... +----------------------------------------------------------+ Creating PHP directory
/usr/share/ocsinventory-reports/ocsreports. +----------------------------------------------------------+ Setup has created a log file
/usr/local/share/ocsinventory-ng/ocs_server_setup.log. Please,
save this file. DON'T FORGET TO RESTART APACHE
DAEMON ! Enjoy OCS Inventory NG ;-) |
標準以外の入力が必要なのはapacheのユーザー「www」の入力と、ApacheのIncludeファイルの場所を答える時だけです。 それだけでプログラムのインストール完了です。 次にデータベースを設定します。 データベースはブラウザーからセットアップします。 セットアップの前にデータベースを作っておきます。この作業をしないとデータベースがLatin1で作られてしまいます。
|
# mysql
-p |
デフォルト値のocsとそのパスワードではなく、管理者アカウントであるrootとそのパスワードを指定します。
初期データベースが作られました。
ブラウザでhttp://server/ocsreports/をアクセスします。
まだ英語のモードですので、日本の国旗をクリックします。
ユーザーに「Admin」パスワードに「admin」を入れて「送信」ボタンを押します。
管理者である「Admin」ユーザーのパスワードを変更して、インストールは完了です。
お疲れ様でした。
glpiは日本語化されていますので連携をとるのはそんなに難しくないです。
ocsデータベースの情報をglpiにインポートするときに文字化けしないようにするのも簡単です。
その点につきましてはあらためてドキュメントを書き残す予定です。