2014/11/24 桜井耕造
OCS Inventory NGエージェントのインストール手順
2014/11/24 桜井耕造
OCS Inventory NGエージェントのインストール手順
OCS Inventory NGエージェントのインストール手順を紹介します。OCSは様々なOSに対応しています。
Linux、Windows、MacOSなど・・・
ここでは、CentOS6.5にエージェントを入れて、データ転送するまで解説します。
マネージャーの導入については、こちらをご参照下さい。
OCS Inventory NGの機能: 説明は、こちら
OCS Inventory NGマネージャーのインストール: こちら
(1)OCS Inventory NGエージェントのインストール
この手順は、CentOS6.5のものです。導入マニュアルは以下のURLが参考になると思います。
http://wiki.ocsinventory-ng.org/index.php/Documentation:Server
(2)前提パッケージのインストール
以下のパッケージは標準のレポジトリに存在しないため、epel経由でインストールします。
# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm # rpm -ivh epel-release-6-8.noarch.rpm # yum install ?y ?-enablerepo=epel perl-Apache-DBI perl-Apache2-SOAP perl-XML-Entities
前提パッケージをインストールします。
# yum install perl # yum install perl-XML-Simple # yum install perl-Compress-Zlib # yum install perl-Net-IP # yum install perl-Net-SSLeay # yum install perl-Crypt-SSLeay # yum install perl-Net-SNMP # yum install perl-Proc-Daemon # yum install perl-Proc-PID-File # yum install pciutils # yum install smartmontools # yum install monitor-edid # yum install dmidecode pciutils make gcc # yum install cpan # yum install wget //rpmでは、6.55がインストールされてしまい、OCS Inventory NGをインストールできないので、CPANよりExtUtils::MakeMaker 6.59をインストールします。 # cpan cpan[1]> install ExtUtils::MakeMaker cpan[1]> exit // 動作上、問題ないのですが、OCSにてLinuxのバージョンを正確に取得したい場合は、『redhat-lsb』のパッケージをインストールする必要があります。様々のパッケージがインストールされますので、内容をご確認の上インストールして下さい。 # yum install redhat-lsb
(3)OCS Invetory NGエージェントをインストール
# wget wget https://launchpad.net/ocsinventory-unix-agent/stable-2.1/2.1/+download/Ocsinventory-Unix-Agent-2.1.tar.gz # tar zxvf Ocsinventory-Unix-Agent-2.1.tar.gz # cd Ocsinventory-Unix-Agent-2.1 # PERL_AUTOINSTALL=1 perl Makefile.PL # make # make install
(4)OCS Invetory NGの設定
# cd /tmp/Ocsinventory-Unix-Agent-2.1 # perl postinst.pl ?-nowizard ?-server=http://(マネージャーのIPアドレス)/ocsreports ?-crontab -?tag=ad-inventry --logfile=/var/log/ocsinventory-agent.log --download ?-user=ocs --password=ocs Where do you want to write the configuration file? 0 -> /etc/ocsinventory 1 -> /usr/local/etc/ocsinventory 2 -> /etc/ocsinventory-agent > 2 What is the address of your ocs server?> (マネージャーのIPアドレス) Should I remove the old linux_agent Please enter 'y' or 'n'?> [n] y Do you want to set CA certificate chain file path ? Please enter 'y' or 'n'?> [y] n //以下のコメントが表示されたらインストール成功です。 -> Success! New settings written! Thank you for using OCS Inventory
(5)インベントリ通知
インストールすると、cronに自動登録されますが、以下のコマンドでもインベントリ通知されます。
# ocsinventory-agent
以上で、OCSマネージャーにリポジトリ情報が転送されて、管理できるようになります。