LoginSignup
2
0

More than 5 years have passed since last update.

OCS Inventory NGのインストール

Last updated at Posted at 2018-10-23

OCS Inventory NG とは

オープンソースの(PC系)資産管理ソフト。管理対象にエージェントをインストールし、エージェントからの報告をリスト化する。エージェントの対応OSはWindows、Linux、Mac、Android。

参考にしたもの

IT資産管理をオープンソースだけでやってみたメモ(OCS Inventory NG + GLPI)
Setting up OCS Inventory Server

大変参考になりました。ありがとうございます。

自分はDockerに関して初学未満であるため、1台のサーバーにすべて詰め込む事とした。

おおまかな流れ

概ね公式マニュアルに従えば良い。
ただし、この後GLPIをインストールする予定であれば、PHP5.6以上が必須となるので、注意する必要がある。先にPHP5.6以上を導入しておき、以降の手順でyum installする際には--enablerepo=remi,remi-phpXX(バージョン表記)を付記すること。

  • EPELを導入する
  • ウェブサーバーを用意する
  • データベースを用意する
  • こまごまとしたものを用意する
  • yum でインストールする
  • ログイン画面の言語選択部分を修正する

要求パッケージ

Requirements
・Apache version 2.2 or higher.
 ・Mod_perl version 1.29 or higher.
・PHP 5.5 or higher, with ZIP and GD support enabled.
 ・php_curl
 ・php_mbstring
 ・php_soap
 ・php_xml
・PERL 5.6 or higher.
 ・Perl module XML::Simple version 2.12 or higher.
 ・Perl module Compress::Zlib version 1.33 or higher.
 ・Perl module DBI version 1.40 or higher.
 ・Perl module DBD::Mysql version 2.9004 or higher.
 ・Perl module Apache::DBI version 0.93 or higher.
 ・Perl module Net::IP version 1.21 or higher.
 ・Perl module SOAP::Lite version 0.66 or higher (optional)
 ・Perl module Mojolicious::Lite
 ・Perl module Plack::Handler
 ・Perl module Archive::Zip
 ・Perl module YAML
 ・Perl module XML::Entities
・MySQL or MariaDB version 4.1.0 or higher with InnoDB engine active. Mysql version upper than 5.5 are not supported but may work.
・Make utility such as GNU make.

EPELを導入する

yum -y install epel-release

ウェブサーバーを用意する

・Apache version 2.2 or higher.
 ・Mod_perl version 1.29 or higher.

yum -y install httpd

データベースを用意する

・MySQL or MariaDB version 4.1.0 or higher with InnoDB engine active. Mysql version upper than 5.5 are not supported but may work.

Note : We highly recommend to use mariaDB

謎のmariaDB推し。或いはOracle除けなのか。従うことにする。

yum -y install mariadb

必要なデータベースは後工程で作成される模様。

こまごまとしたものを用意する

yum -y install perl-XML-Simple perl-Compress-Zlib perl-DBI perl-DBD-MySQL perl-Net-IP perl-SOAP-Lite perl-Archive-Zip perl-Mojolicious perl-Plack perl-XML-Entities perl-Switch php-pecl-zip php-gd

yum でインストールする

wget https://rpm.ocsinventory-ng.org/ocsinventory-release-latest.el7.ocs.noarch.rpm
yum -y install ocsinventory-release-latest.el7.ocs.noarch.rpm
yum -y install ocsinventory-server ocsinventory-reports

インストール後、httpdを再起動すれば、webからのインストール工程となる。

http://サーバーのIPアドレス/ocsreports/install.php

データベース管理者のユーザー名とパスワード、初期データベース名(ocsweb)とデータベースサーバーIPアドレスを入力。
データベース名はphpファイルに記載されているため、変更するのであれば修正が必要。

ログイン画面の言語選択部分を修正する(2.5では不要)

投稿時点でyumインストールされるバージョンは2.4.1なのだが、ログイン画面に不具合があり、日本語を選択することができない。

OCS Inventory-2018-10-23 10_38_16.png

ブラウザでソースコードを見てみると、tr_TRとja_JPの間にカンマがない。

view-source_tokyosv10.domain.nichigaku.co.jp_ocsreports_index.php-2018-10-23 10_38_43_s.png

調べた結果、カンマを入れるループ回数が固定されていたので、39行目の12を13に修正。より良いやり方もあるだろうが、2.5では修正されているようなので簡便な方法をとった。

/var/lib/ocsinventory-reports/plugins/language/language.php

// 中略
$protectedPost['LANG'] = $_SESSION["OCS"]["LANGUAGE"];
while (isset($list_plugins[$i])) {

  if($i == 13){ // 12を13に修正した
    $select_lang .= $list_plugins[$i];
  } else {
    $select_lang .= $list_plugins[$i] .',';
  }

  $show_lang = "<label for='LANGUAGE'>".$l->g(1012)."</label>
                <div class='bfh-selectbox bfh-languages'  data-language='".$protectedPost['LANG']."' data-available='" . $select_lang . "' data-flags='true' data-blank='false'>
                    <input type='hidden' value=''>
                    <a class='bfh-selectbox-toggle' role='button' data-toggle='bfh-selectbox' href='#'>
                        <span class='bfh-selectbox-option input-medium' data-option=''></span>
                        <b class='caret'></b>
                    </a>
                    <div class='bfh-selectbox-options'>
                        <div role='listbox'>
                            <ul role='option'>
                            </ul>
                        </div>
                    </div>
                </div>";

      $i++;
}

なおった。

OCS Inventory-2018-10-23 11_09_12.png

その他必要なこと

  • データベースの名前やアクセスするための情報を既定のものから変更する。
  • エージェントを配布する
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0