需要的包有:
[root@cacti 5]# cd i686/
[root@cacti i686]# ll
total 1604
-rw-r--r-- 1 root root  80769 Jul 13 13:48 monitor-edid-2.5-1.el5.1.i386.rpm
-rw-r--r-- 1 root root 688084 Jul 13 13:48 nmap-4.11-1.1.i386.rpm
-rw-r--r-- 1 root root 159196 Jul 13 13:48 ocsinventory-agent-1.1.2-1.el5.noarch.rpm
-rw-r--r-- 1 root root  45966 Jul 13 13:48 perl-Crypt-SSLeay-0.51-11.el5.i386.rpm
-rw-r--r-- 1 root root  31465 Jul 13 13:48 perl-Net-IP-1.25-2.fc6.noarch.rpm
-rw-r--r-- 1 root root 199746 Jul 13 13:48 perl-Net-SSLeay-1.30-4.fc6.i386.rpm
-rw-r--r-- 1 root root   9675 Jul 13 13:48 perl-Proc-Daemon-0.03-1.el5.noarch.rpm
-rw-r--r-- 1 root root  15709 Jul 13 13:48 perl-XML-NamespaceSupport-1.09-1.2.1.noarch.rpm
-rw-r--r-- 1 root root 214759 Jul 13 13:48 perl-XML-Parser-2.34-6.1.2.2.1.i386.rpm
-rw-r--r-- 1 root root  78375 Jul 13 13:48 perl-XML-SAX-0.14-8.noarch.rpm
-rw-r--r-- 1 root root  69742 Jul 13 13:48 perl-XML-Simple-2.14-4.fc6.noarch.rpm
 
如果是x86_64
[root@cacti x86_64]# ls -l
total 1616
-rw-r--r-- 1 root root  83624 Jul 13 13:47 monitor-edid-2.5-1.el5.1.x86_64.rpm
-rw-r--r-- 1 root root 696513 Jul 13 13:47 nmap-4.11-1.1.x86_64.rpm
-rw-r--r-- 1 root root 159196 Jul 13 13:47 ocsinventory-agent-1.1.2-1.el5.noarch.rpm
-rw-r--r-- 1 root root  45932 Jul 13 13:47 perl-Crypt-SSLeay-0.51-11.el5.x86_64.rpm
-rw-r--r-- 1 root root  31465 Jul 13 13:47 perl-Net-IP-1.25-2.fc6.noarch.rpm
-rw-r--r-- 1 root root 196545 Jul 13 13:47 perl-Net-SSLeay-1.30-4.fc6.x86_64.rpm
-rw-r--r-- 1 root root   9675 Jul 13 13:47 perl-Proc-Daemon-0.03-1.el5.noarch.rpm
-rw-r--r-- 1 root root  15709 Jul 13 13:47 perl-XML-NamespaceSupport-1.09-1.2.1.noarch.rpm
-rw-r--r-- 1 root root 215043 Jul 13 13:47 perl-XML-Parser-2.34-6.1.2.2.1.x86_64.rpm
-rw-r--r-- 1 root root  78375 Jul 13 13:47 perl-XML-SAX-0.14-8.noarch.rpm
-rw-r--r-- 1 root root  69742 Jul 13 13:47 perl-XML-Simple-2.14-4.fc6.noarch.rpm
安装脚本如下:
#!/bin/bash
release=`lsb_release -r |awk '{print $2}'`
arch=`arch`
#release=$2
#arch=$3
echo "this os release is  Enterprise Linux Enterprise Linux Server release $release $arch"

case "$1" in
 install)
        
         case "$arch" in
        x86_64)
            cd $release/$arch         
        echo "install ocs agent for ES $release $arch"
        rpm -Uvh *.rpm
               ;;
   i*86)
        cd $release/i686
               echo "install ocs agent for ES $release $arch"        
        rpm -Uvh *.rpm
                             ;;
  esac
  
                echo "ocs install completed."
  ;;
 uninstall)
  rpm -e ocsinventory-agent
  echo "ocs uninstall completed."
  ;;
 run)
  ocsinventory-agent -l ./output
  echo "please send ./`hostname -s`*.ocs to administraotr. Thank you."
  ;;
 *)
  echo $"Usage: $0 {install|uninstall|run}"
  exit 1
esac
安装
./ocs.sh install
运行
./ocs.sh run
另外一种方法:
只需要2个包
Ocsinventory-Agent-1.1.2.tar.gz
XML-Simple-2.18.tar.gz
解压2个包,
cd XML-Simple-2.18
perl Makefile.PL
make
make install
cd ..
cd Ocsinventory-Agent-1.1.2
perl Makefile.PL
make
make install
cd ..
收集信息
ocsinventory-agent -l  ./ocs/output
这样所有信息都保存在ouput目录下