下面我将描述如何安装 OCSNG 服务器和客户端.服务器的安装在 openSuse Linux 中,文中将提到 Linux 和 Windows 代理的安装方法.最终能在界面中看到两个节点的清单信息,不过只有 Linux 的哪个会每天更新.This article is talking about how to install OCSNG 1.0.1 on a openSuSE 10.2 system.
- Requirements: You have to meet the following requirements. Apache version 1.3.33 or higher / Apache version 2.0.46 or higher. Mod_perl version 1.29 or higher. Mod_php version 4.3.2 or higher. PHP 4.3.2 or higher, with ZIP and GD support enabled. 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 (not mandatory) MySQL version 4.1.0 or higher with InnoDB engine active. Make utility like GNU make.If you can use yast for managing package, I believe you could install all of them within 20 minutes. I won’t say more about this.
- Installing Management/communication Server and Web Console You must have root privileges to setup management server. Login OS as root, then do the following:1)Download install package from http://nchc.dl.sourceforge.net/sourceforge/ocsinventory/OCSNG_LINUX_SERVER_1.01.tar.gz2)unpack itSuse:/mnt/hgfs/win/OCSNG # cp OCSNG_LINUX_SERVER_1.01.tar.gz /rootSuse:/mnt/hgfs/win/OCSNG # cdSuse:~ # tar zxf OCSNG_LINUX_SERVER_1.01.tar.gzSuse:~ # cd OCSNG_LINUX_SERVER_1.01/Suse:~/OCSNG_LINUX_SERVER_1.01 #3)run installerSuse:~/OCSNG_LINUX_SERVER_1.01 # sh setup.sh+———————————————————-+| || Welcome to OCS Inventory NG Management server setup ! || |+———————————————————-+CAUTION: If upgrading Communication server from OCS Inventory NG 1.0 RC2 andprevious, please remove any Apache configuration for Communication Server!Do you wish to continue ([y]/n)?yAssuming Communication server 1.0 RC2 or previous is not installedon this computer.Starting OCS Inventory NG Management server setup from folder /root/OCSNG_LINUX_SERVER_1.01Storing log in file /root/OCSNG_LINUX_SERVER_1.01/ocs_server_setup.log+———————————————————-+| Checking for database server properties… |+———————————————————-+Your MySQL client seems to be part of MySQL version 5.0.Your computer seems to be running MySQL 4.1 or higher, good ;-)Which host is running database server [localhost] ?OK, database server is running on host localhost ;-)On which port is running database server [3306] ?OK, database server is running on port 3306 ;-)+———————————————————-+| Checking for Apache web server daemon… |+———————————————————-+which: no httpd in (/sbin:/usr/sbin:/usr/local/sbin:/opt/gnome/sbin:/root/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/opt/opennms/bin)which: no apache in (/sbin:/usr/sbin:/usr/local/sbin:/opt/gnome/sbin:/root/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/opt/opennms/bin)which: no apache2 in (/sbin:/usr/sbin:/usr/local/sbin:/opt/gnome/sbin:/root/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/opt/opennms/bin)Where is Apache daemon binary [] ?/usr/sbin/httpd2OK, using Apache daemon /usr/sbin/httpd2 ;-)+———————————————————-+| Checking for Apache main configuration file… |+———————————————————-+Where is Apache main configuration file [/srv/www//etc/apache2/httpd.conf] ?/etc/apache2/httpd.confOK, using Apache main configuration file /etc/apache2/httpd.conf ;-)+———————————————————-+| Checking for Apache user account… |+———————————————————-+Which user account is running Apache web server [] ?wwwrunOK, Apache is running under user account wwwrun ;-)+———————————————————-+| Checking for Apache group… |+———————————————————-+Which user group is running Apache web server [wwwrun] ?wwwOK, Apache is running under users group www ;-)+———————————————————-+| Checking for PERL Interpreter… |+———————————————————-+Found PERL Intrepreter at ;-)Where is PERL Intrepreter binary [/usr/bin/perl] ?/usr/bin/perlOK, using PERL Intrepreter /usr/bin/perl ;-)Do you wish to setup Communication server on this computer ([y]/n)?y+———————————————————-+| Checking for Make utility… |+———————————————————-+OK, Make utility found at ;-)+———————————————————-+| Checking for Apache Include configuration directory… |+———————————————————-+Setup has found Apache Include configuration directory in.If you are not using Include directive, please enter ’no’.Where is Apache Include configuration directory [] ?/etc/apache2/conf.dOK, Apache Include configuration directory /etc/apache2/conf.d found ;-)+———————————————————-+| Checking for Apache mod_perl version… |+———————————————————-+Checking for Apache mod_perl version 1.99_22 or higherFound that mod_perl version 1.99_22 or higher is available.OK, Apache is using mod_perl version 1.99_22 or higher ;-)+———————————————————-+| Checking for Communication server log directory… |+———————————————————-+Communication server can create detailled logs. This logs can be enabledby setting interger value of LOGLEVEL to 1 in Administration consolemenu Configuration.Where to put Communication server log directory [/var/log/ocsinventory-NG] ?OK, Communication server will put logs into directory /var/log/ocsinventory-NG ;-)+———————————————————-+| Checking for required Perl Modules… |+———————————————————-+Checking for DBI PERL module…Found that PERL module DBI is available.Checking for Apache::DBI PERL module…Found that PERL module Apache::DBI is available.Checking for DBD::mysql PERL module…Found that PERL module DBD::mysql is available.Checking for Compress::Zlib PERL module…Found that PERL module Compress::Zlib is available.Checking for XML::Simple PERL module…Found that PERL module XML::Simple is available.Checking for Net::IP PERL module…Found that PERL module Net::IP is available.Checking for SOAP::Lite PERL module…Found that PERL module SOAP::Lite is available.+———————————————————-+| OK, looks good ;-) || || Configuring Communication server Perl modules… |+———————————————————-+WARNING: INSTALLSITESCRIPT is not a known parameter.Checking if your kit is complete…Looks good‘INSTALLSITESCRIPT’ is not a known MakeMaker parameter name.Writing Makefile for Apache::Ocsinventory+———————————————————-+| OK, looks good ;-) || || Preparing Communication server Perl modules… |+———————————————————-++———————————————————-+| OK, prepare finshed ;-) || || Installing Communication server Perl modules… |+———————————————————-++———————————————————-+| OK, Communication server Perl modules install finished;-)|| || Creating Communication server log directory… |+———————————————————-+Creating Communication server log directory /var/log/ocsinventory-NG.Fixing Communication server log directory files permissions.Configuring logrotate for Communication server.Writing communication server logrotate to file /etc/logrotate.d/ocsinventory-NG+———————————————————-+| OK, Communication server log directory created ;-) || || Now configuring Apache web server… |+———————————————————-+Writing communication server configuration to file /etc/apache2/conf.d/ocsinvent+———————————————————-+| OK, Communication server setup sucessfully finished ;-) || || Please, review /etc/apache2/conf.d/ocsinventory.conf| to ensure all is good. Then restart Apache daemon. |+———————————————————-+Do you wish to setup Administration server (web administration console)on this computer ([y]/n)?y+———————————————————-+| Checking for Apache root document directory… |+———————————————————-+Where is Apache root document directory [] ?/srv/www/htdocsOK, Apache root document directory is /srv/www/htdocs ;-)+———————————————————-+| Checking for required Perl Modules… |+———————————————————-+Checking for DBI PERL module…Found that PERL module DBI is available.Checking for DBD::mysql PERL module…Found that PERL module DBD::mysql is available.Checking for XML::Simple PERL module…Found that PERL module XML::Simple is available.Checking for Net::IP PERL module…Found that PERL module Net::IP is available.+———————————————————-+| Installing files for Administration server… |+———————————————————-+Creating directory /srv/www/htdocs/download.Creating directory /srv/www/htdocs/ocsreports.Copying files to /srv/www/htdocs/ocsreports.Fixing directories and files permissions.Configuring IPDISCOVER-UTIL Perl script.Installing IPDISCOVER-UTIL Perl script.Fixing permissions on IPDISCOVER-UTIL Perl script.+———————————————————-+| OK, Administration server installation finished ;-) || || Point your browser to http://server/ocsreports to || configure database server and create/update schema. |+———————————————————-+Setup has created a log file /root/OCSNG_LINUX_SERVER_1.01/ocs_server_setup.log. Please, save this file.If you encounter error while running OCS Inventory NG Management server,we can ask you to show us his content !DON’T FORGET TO RESTART APACHE DAEMON !Enjoy OCS Inventory NG ;-)Suse:~/OCSNG_LINUX_SERVER_1.01 #Suse:~/OCSNG_LINUX_SERVER_1.01 # /etc/init.d/apache2 restartSyntax OKShutting down httpd2 (waiting for all children to terminate) doneStarting httpd2 (prefork) doneSuse:~/OCSNG_LINUX_SERVER_1.01 #As we can see the installation is successful. If you are running a different Linux, you should input other settings.
- Configuring Management Server The following is a post-install setup for management server. Y will go through it from a web browser. Open FireFox it is my current favorite browser and point it on URL http://Ip_address/ocsreportsThe first warning message should be this.WARNING: You will not be able to build any auto deployment package with size greater than 2M.You must raise both post_max_size and upload_max_filesize in your php.ini to correct this.Do the following to fix it:# vi php.iniThe default post_max_size is 8M, we are going to increase upload_max_filesize to 12M; Maximum allowed size for uploaded files.upload_max_filesize = 12MWe should restart apache to take it effectRun this command: /etc/init.d/apache2 restartPress F5 to refresh the first web page, this warning is still there. Let’s just go ahead to input the mysql >
- Setting up Agents on openSuse and a Windows Xp client. Download agent packages from internet.Installing a Linux agent:Suse:~ # tar zxf OCSNG_LINUX_AGENT_1.01.tar.gzSuse:~ # cd OCSNG_LINUX_AGENT_1.01/Suse:~/OCSNG_LINUX_AGENT_1.01 # sh setup.sh+———————————————————-+| || Welcome to OCS Inventory NG Agent setup ! || |+———————————————————-+Writing log to file /root/OCSNG_LINUX_AGENT_1.01/ocs_agent_setup.log+———————————————————-+| Checking for previous installation… |+———————————————————-+Previous installation of OCS Inventory NG agent not found+———————————————————-+| Checking for supplied parameters… |+———————————————————-+No parameter foundOCS Inventory NG Agent setup running in user interactive mode+———————————————————-+| Checking for OCS Inventory NG Agent running method… |+———————————————————-+OCS Inventory NG Agent can be run through 2 methods:- local: inventory will be generated locally to a file, withoutinteracting with Communication Server. Inventory resultsmust then be imported manually into the server throughAdministration Console.- http: Agent can connect to Communication Server and will interactwith it to know what is has to do (inventory, ipdiscover,deployment…)Which method will you use to generate the inventory ([http]/local) ?OK, OCS Inventory NG agent will be running in mode ;-)+———————————————————-+| Checking for OCS Inventory NG Communication Server… |+———————————————————-+Which host is running OCS Inventory NG Communication Server [] ?localhostOn which port is running OCS Inventory NG Communication Server [80] ?OK, OCS Inventory NG Communication Server is running on host and port <80> ;-)+———————————————————-+| Checking for TAG administrative information value… |+———————————————————-+What is the value of TAG ([]) ?LiuZhengOK, OCS Inventory NG agent will use as ;-)+———————————————————-+| Checking for PERL Interpreter… |+———————————————————-+OK, PERL Intrepreter found at ;-)+———————————————————-+| Checking for C/C++ Compiler… |+———————————————————-+OK, C/C++ Compiler found at ;-)+———————————————————-+| Checking for Make utility… |+———————————————————-+OK, Make utility found at ;-)+———————————————————-+| Checking for dmidecode binaries… |+———————————————————-+Found dmidecode binaries version <2.8> at ;-)+———————————————————-+| Checking for Compress::Zlib PERL module… |+———————————————————-+OK, PERL module Compress::Zlib is available ;-)+———————————————————-+| Checking for XML::Simple PERL module… |+———————————————————-+OK, PERL module XML::Simple is available ;-)+———————————————————-+| Checking for Net::IP PERL module… |+———————————————————-+OK, PERL module Net::IP is available ;-)+———————————————————-+| Checking for LWP::UserAgent PERL module… |+———————————————————-+OK, PERL module LWP::UserAgent is available ;-)+———————————————————-+| Checking for Digest::MD5 PERL module… |+———————————————————-+OK, PERL module Digest::MD5 is available ;-)+———————————————————-+| Checking for Net::SSLeay PERL module… |+———————————————————-+OK, PERL module Net::SSLeay is available ;-)+———————————————————-+| Installing IPDISCOVER binary… |+———————————————————-+Building IPDISCOVER version 3Installing IPDISCOVER version 3 into /usr/sbinOK, IPDISCOVER version 3 setup successfully ;-)+———————————————————-+| Installing OCS Inventory NG Agent… |+———————————————————-+Configuring OCS Inventory NG AgentBuilding OCS Inventory NG AgentInstalling OCS Inventory NG AgentCreating OCS Inventory NG Agent symbolic linkOK, OCS Inventory NG Agent setup successfully ;-)+———————————————————-+| Creating OCS Inventory NG Agent log directory… |+———————————————————-+Creating OCS Inventory NG Agent log directory .Configuring logrotate for OCS Inventory NG Agent.Writing OCS Inventory NG Agent logrotate to file+———————————————————-+| Installing OCS Inventory NG Agent configuration files… |+———————————————————-+Creating OCS Inventory NG Agent configuration fileCreating OCS Inventory NG Agent configuration directoryWriting OCS Inventory NG Agent configuration fileCreating OCS Inventory NG Agent configuration fileWriting OCS Inventory NG Agent configuration fileOK, OCS Inventory NG Agent configuration files setup successfully ;-)+———————————————————-+| Installing OCS Inventory NG Agent cron configuration… |+———————————————————-+Creating OCS Inventory NG Agent cron configuration fileWriting OCS Inventory NG Agent cron configuration fileOK, OCS Inventory NG Agent cron configuration file setup successfully ;-)+———————————————————-+| Lauching OCS Inventory NG Agent… |+———————————————————-+OK, OCS Inventory NG Agent runs successfully ;-)Setup has created a log file /root/OCSNG_LINUX_AGENT_1.01/ocs_agent_setup.log. Please, save this file.If you encounter error while running OCS Inventory NG Agent,we can ask you to show us his content !Enjoy OCS Inventory NG ;-)Suse:~/OCSNG_LINUX_AGENT_1.01 #The installer will install agent and a cron job on target Linux system. The job will launch OCS Inventory NG Agent once a day under root account, that means a update will get into database every day. Now you will see one single node in the web console.->Installing a Windows AgentOCSNG 1.01 does not support Vista yet, so I tested it on Windows Xp/2K/2K3 and it works very well.You will donwload OCSNG_WIN32_AGENT_1.01_repack.zipUnzip it and run ocsagent.exe. I’d like to test a standalone version agent, it is not a service version agent.Double click ocsagent.exe, then you will get a new folder C:\ocs-ngCreate a batch file in this folder.My scan.bat file as below:OCSInventory.exe /server:Ip_Address_of_server /np /tag:“LiuZheng” /hkcu /forceIn order to get inventory scan into database, you will double click scan.bat file. Now, you will get one more node in web console. It is a good idea to copy c:\ocs-ng folder on a USB key. Then you are able to run inventory scan on other Windows machines. If you are going to get update inventory from Windows machines, you have to install OcsAgentSetup.exe agent on them.If you have any issue please add a comment blow or send me a email. I could help you later if I might have any idea.OCSNG现在还没有中文的界面,它的代理和服务器端是支持中文的.如果你在一些中文的操作系统上做了清单扫描,扫描的某些信息在Webconsole中查看的结果可能是乱码.这时候,你可以进入浏览器的内码设置,设置成中文后,你会看到正常的中文显示.这说明它是可以支持多语言的.为了在做资产管理的时候对于用户比较方便,我们可以是用gpli项目. GPLI有中文界面,而且能提供流程支持.GPLI的安装和配置手册待续.这个安装手册用英文写,如果给您带了了不便请谅解,您有什么问题的话欢迎给我留言,谢谢观看!