先日投稿した『OCS Inventory-NGサーバーインストールと設定』のエージェント版です。
環境
OS | CentOS 6.4とCentOS 5.8 64bit |
---|---|
OCSバージョン | ocsinventory-agent-1.1.2.1-1 |
OCSサーバーURL | http://example.com/ocsinventory/ |
インストール
epelを有効にしてからyumコマンドでインストールします。
yum install ocsinventory-agent.noarch
設定
/etc/ocsinventory/ocsinventory-agent.cfg
# server = your.ocsserver.name
↓
server = http://example.com/ocsinventory/
※OCSサーバーのURLを設定してください。
local = /var/lib/ocsinventory-agent
↓
#local = /var/lib/ocsinventory-agent
※このコメントアウトしないとcron経由でOCSサーバーに情報が送信されません。
# tag = your_tag
↓
tag = クライアントサーバーホスト名
※このtagの設定はホスト名じゃなくてもOKです。
資産管理番号など分かりやすい目印的なものを付けてあげるのがベスト。
/etc/sysconfig/ocsinventory-agent
OCSMODE[0]=none
↓
OCSMODE[0]=cron
※noneからcronへ。
実行
以下コマンドを打つことでOCSサーバーに情報が送られます。
/usr/sbin/ocsinventory-agent
エラー対処
上記実行コマンドを打つと以下のようなエラーが出ることがあります。
CentOS5系で起きます。
エラー対処その1
error: dbus_bus_get: org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
このエラーが出た場合は↓のコマンドを実行してください。
/etc/init.d/messagebus start /sbin/chkconfig messagebus on
エラー対処その2
error: libhal_ctx_init: (null): (null) Could not initialise connection to hald. Normally this mean the HAL daemon (hald) is not running or not ready. lshal.c 689 : INFO: called LIBHAL_FREE_DBUS_ERROR but dbusError was not set. error: libhal_ctx_init: (null): (null) Could not initialise connection to hald. Normally this mean the HAL daemon (hald) is not running or not ready. lshal.c 689 : INFO: called LIBHAL_FREE_DBUS_ERROR but dbusError was not set.
このエラーが出た場合は↓のコマンドを実行してください。
/etc/init.d/haldaemon start /sbin/chkconfig haldaemon on