linux 安装Ocsinventory-Agent配置

作者: admin 分类: Linux 发布时间: 2018-07-10 16:29 浏览:316 次    

环境:centos7        Ocsinventory-Unix-Agent-2.3

1、配置YUM扩展源

 [root@i-tdcfaqgw ~]# rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/epel-release-latest-7.noarch.rpm

2、安装依懒包

[root@i-tdcfaqgw ~]#  yum install -y perl-XML-Simple perl-Compress-Zlib perl-Net-IP perl-Net-SSLeay perl-Crypt-SSLeay perl-XML-SAX perl-XML-LibXML perl-ExtUtils-Embed

3、创建ca、日志目录

[root@i-tdcfaqgw ~]# mkdir  /var/log/ocs-agent
[root@i-tdcfaqgw ~]# mkdir  /var/ca

4、下载客户端

[root@i-tdcfaqgw ~]# wget https://github.com/OCSInventory-NG/UnixAgent/releases/download/2.3/Ocsinventory-Unix-Agent-2.3.tar.gz

5、解压

[root@i-tdcfaqgw ~]# tar xf Ocsinventory-Unix-Agent-2.3.tar.gz 
[root@i-tdcfaqgw ~]#  cd Ocsinventory-Unix-Agent-2.3

6、编译安装

[root@i-tdcfaqgw Ocsinventory-Unix-Agent-2.3]# perl Makefile.PL 
[root@i-tdcfaqgw Ocsinventory-Unix-Agent-2.3]# make
[root@i-tdcfaqgw Ocsinventory-Unix-Agent-2.3]#  make install
#安装在/usr/local/share/perl5 下面
Installing /usr/local/bin/ocsinventory-agent
Appending installation info to /usr/lib64/perl5/perllocal.pod
[ ! -f run-postinst ] || /usr/bin/perl postinst.pl
Do you want to configure the agent      
Please enter 'y' or 'n'?> [y]               #配置agent
Where do you want to write the configuration file?
 0 -> /etc/ocsinventory
 1 -> /usr/local/etc/ocsinventory
 2 -> /etc/ocsinventory-agent
?>      #配置文件放在/etc/ocsinventory-agent目录下           
Do you want to create the directory /etc/ocsinventory-agent?
Please enter 'y' or 'n'?> [y]       #创建配置文件        
Should the old unix_agent settings be imported ?
Please enter 'y' or 'n'?> [y]    
[info] The config file will be written in /etc/ocsinventory-agent/ocsinventory-agent.cfg,
What is the address of your ocs server?> 10.6.4.240    #设置服务器IP
Do you need credential for the server? (You probably don't)
Please enter 'y' or 'n'?> [n]        #设置证书        
Do you want to apply an administrative tag on this machine
Please enter 'y' or 'n'?> [y]          
tag?> i-tdcfaqgw                       #设置标签
Do yo want to install the cron task in /etc/cron.d
Please enter 'y' or 'n'?> [y]       #建立任务计划
Where do you want the agent to store its files? (You probably don't need to change it)?> [/var/lib/ocsinventory-agent] 
Do you want to create the /var/lib/ocsinventory-agent directory?

Please enter 'y' or 'n'?> [y] 
Should I remove the old unix_agent
Please enter 'y' or 'n'?> [n] 
Do you want to activate debug configuration option ?
Please enter 'y' or 'n'?> [y] 
Do you want to use OCS Inventory NG UNix Unified agent log file ?
Please enter 'y' or 'n'?> [y] 
Specify log file path you want to use?> /var/log/ocs-agent      #设置日志路径
Do you want disable SSL CA verification configuration option (not recommended) ?
Please enter 'y' or 'n'?> [n] 
Do you want to set CA certificate chain file path ?
Please enter 'y' or 'n'?> [y] 
Specify CA certificate chain file path?> /var/ca              #设置ca路径
Do you want to use OCS-Inventory software deployment feature?
Please enter 'y' or 'n'?> [y] 
Do you want to use OCS-Inventory SNMP scans feature?
Please enter 'y' or 'n'?> [y] 
Do you want to send an inventory of this machine?
Please enter 'y' or 'n'?> [y] 
Setting OCS Inventory NG server address...
Looking for OCS Invetory NG Unix Unified agent installation...
ocsinventory agent presents: /usr/local/bin/ocsinventory-agent
Setting crontab...
Creating /var/lib/ocsinventory-agent directory...
Creating /etc/ocsinventory-agent directory...
Writing OCS Inventory NG Unix Unified agent configuration
Creating /var/lib/ocsinventory-agent/http:__10.6.4.240_ocsinventory directory...
Creating /var/lib/ocsinventory-agent/http:__10.6.4.240_ocsinventory/snmp directory...
Copying SNMP MIBs XML files...
Activating modules if needed...
Launching OCS Inventory NG Unix Unified agent...
 -> Success!                #看到success已成功安装
New settings written! Thank you for using OCS Inventory

注:以上除红色部分需要手动指定外,其它全部回车即可!

7、验证

  • 服务器看到相应主机配置

%title插图%num

 


温馨提示:如无特殊说明,本站文章均为作者原创,转载时请注明出处及相应链接!

发表评论