O
OCS é um software livre que permite aos usuários deste serviço criar inventários de toda a sua estrutura de TI. Ele coleta informações tanto do hardware quanto do software das máquinas da rede que utilizam seu client. Todo o resultado desta busca é visualizada em sua interface Web.
O OCS é dividido em 3 partes:
- Server;
- Agente;
- Interface Web.
O Server utiliza-se das tecnologias PERL de programação, servidor Web
Apache e banco de dados
MySQL, sendo assim, o OCS é multiplataforma funcionando tanto em UNIXs quanto em Microsoft Windows.
Os agentes responsáveis pela coleta de informações também são multiplataformas e podem ser instalados em:
- Microsoft Windows;
- GNU/Linux;
- Mac OS X;
- Sun Solaris;
- IBM AIX;
- FreeBSD, NetBSD, OpenBSD;
- HP-UX;
- Android.
A interface Web, escrita em PHP, é responsável pela visualização dos dados encontrados.
Instalando as dependências
Instalando o repositório EPEL:
# rpm -Uvh http://fedora.uib.no/epel/6/x86_64/epel-release-6-7.noarch.rpm
Instalando os pacotes:
# yum install perl-XML-Simple perl-Net-SNMP perl-Compress-Zlib perl-Net-IP perl-LWP* perl-Digest-MD4* perl-Net-SSLeay perl-DBI perl-DBD-MySQL perl-Apache-DBI perl-SOAP-Lite perl-XML-Entities perl-Crypt-SSLeay perl-Proc-Daemon perl-Proc-PID-File perl-ExtUtils-MakeMaker perl-YAML perl-XML-SAX-Base mod_perl cpan libvirt -y --skip-broken
# cpan
cpan>
install ExtUtils::MakeMaker
Configurando o banco de dados:
# mysql
>
create database OCS character set utf8;
>
grant all privileges on OCS.* to ocs@localhost identified by 'ocs';
>
flush privileges;
Instalando o OCS Server:
# wget https://launchpad.net/ocsinventory-server/stable-2.0/2.0.5/+download/OCSNG_UNIX_SERVER-2.0.5.tar.gz
# tar -zxvf OCSNG_UNIX_SERVER-2.0.5.tar.gz
# cd OCSNG_UNIX_SERVER-2.0.5/
# ./setup.sh
Obs.: Aceitar todas as configurações padrão de instalação.
Alterar o caminho dos arquivos PHP estáticos no raiz do Web Server, SNMP e Discovery.
Exemplo:
"Where to copy Administration Server static files for PHP Web Console
[/usr/share/ocsinventory-reports] ?/var/www/html
OK, using directory /var/www/html to install static files ;-)
Where to create writable/cache directories for deployement packages,
IPDiscover and SNMP [/var/lib/ocsinventory-reports] ?/var/www/html
Alterar o arquivo "z-ocsinventory-server.conf":
# vim /etc/httpd/conf.d/z-ocsinventory-server.conf
# Master Database settings
# Replace localhost by hostname or ip of MySQL server for WRITE
PerlSetEnv OCS_DB_HOST localhost
# Replace 3306 by port where running MySQL server, generally 3306
PerlSetEnv OCS_DB_PORT 3306
# Name of database
PerlSetEnv OCS_DB_NAME OCS
PerlSetEnv OCS_DB_LOCAL OCS
# User allowed to connect to database
PerlSetEnv OCS_DB_USER ocs
# Password for user
PerlSetVar OCS_DB_PWD ocs
E também alterar o arquivo "ocsinventory-reports.conf":
# vim /etc/httpd/conf.d/ocsinventory-reports.conf
# Some PHP tuning for deployement feature up to 8 MB
# post_max_size must be greater than upload_max_filesize
# because of HTTP headers
php_value post_max_size 201m
php_value upload_max_filesize 200m
Reiniciar o serviço
httpd:
# /etc/init.d/httpd restart
Ou:
# service httpd restart