Olá seja bem vindo ao meu blog, hoje vou falar sobre uma ferramenta que me ajudou muito na hora de fazer inventários de TI, é o OCS Inventory um software conhecido no mercado, porém não encontrei nenhum artigo atualizado das novas versões em português e decidi fazer um.
Deixe seu comentário no final do post.
Cenário:
Sistema Operacional:
Debian Jessie 8.7:
Máquina virtualizada (Usei o Virtual Box mas fica a seu critério)
1GHZ de mémoria ram
Disco Rígido 30Gb
1 Processador Dual Core
Conto que você tenha instalado o Debian com sucesso, vamos ao que interessa:
Atualize os repositórios:
apt-get update -y
apt-get upgrade -y
Instale o servidor de ssh:
apt-get install ssh -y
Esse é um macete para conseguir acessar o servidor remotamente pelo Putty:
apt-get install open-vm-tools sudo make resolvconf -y
Entre no seguinte arquivo e altere para:
nano /etc/sudoers
seu_usuario ALL=NOPASSWD: ALL
Instale o Apache:
apt-get install apache2 -y
Instale os pacotes do Apache:
apt-get install -y php5-common libapache2-mod-php5 php-pear php5-cli php5-ldap libxml-simple-perl libio-compress-perl
libdbi-perl libdbd-mysql-perl libapache-dbi-perl libnet-ip-perl libsoap-lite-perl libarchive-zip-perl
libphp-pclzip php5-gd php5-curl php-soap libsoap-lite-perl
Configure os módulos do CPAN:
cpan -i XML::Entities
Reinicie o Apache:
service apache2 restart
Vamos agora instalar o MYSQL:
apt-get install -y mysql-server php5-mysql
Defina a senha do root
Instale o PHP My Admin:
apt-get install -y phpmyadmin
Selecione o Apache como o seu web server pressione Sim para configurar o db para o PHPMyAdmin e crie um link simbolico para o phpmyadmin com o Apache:
ln -s /etc/phpmyadmin/apache.conf /etc/apache2/sites-enabled/phpmyadmin.conf
service apache2 restart
No seu browser digite o IP do servidor:
http://seuip/phpmyadmin
Entre com a senha de root que você cadastrou na instalação do mysql
Bem agora vamos criar o usuário do OCS, navegue para Usuários , adicionar:
Agora vamos instalar o OCS (FINALMENTE!):
Vamos até o TMP e vamos baixar o OCS:
cd /tmp
wget https://github.com/OCSInventory-NG/OCSInventory-ocsreports/releases/download/2.3/OCSNG_UNIX_SERVER-2.3.tar.gz
Descompacte os arquivos:
tar zxf OCSNG_UNIX_SERVER-2.3.tar.gz
cd OCSNG_UNIX_SERVER-2.3
Dê permissão ao script de setup e execute-o:
chmod 777 setup.sh
./setup.sh
Basta agora ir pressionando o ENTER para as perguntas conforme mostrado abaixo:
Do you wish to continue ([y]/n)? ENTER
Which host is running database server [localhost] ? ENTER
On which port is running database server [3306] ? ENTER
Where is Apache daemon binary [/usr/sbin/apache2ctl] ? ENTER
Where is Apache main configuration file [/etc/apache2/apache2.conf] ? ENTER
Which user account is running Apache web server [www-data] ? ENTER
Which user group is running Apache web server [www-data] ? ENTER
Where is Apache Include configuration directory [/etc/apache2/conf-available] ? ENTER
Where is PERL Intrepreter binary [/usr/bin/perl] ? ENTER
Do you wish to setup Communication server on this computer ([y]/n)? ENTER
Where to put Communication server log directory [/var/log/ocsinventory-server] ? ENTER
Where to put Communication server plugins configuration files [/etc/ocsinventory-server/plugins] ? ENTER
Where to put Communication server plugins Perl modules files [/etc/ocsinventory-server/perl] ? ENTER
Checking for Apache2::SOAP PERL module...
*** Warning: PERL module Apache2::SOAP is not installed !
This module is only required by OCS Inventory NG SOAP Web Service.
Do you wish to continue ([y]/n] ? ENTER
Do you allow Setup renaming Communication Server Apache configuration file
to 'z-ocsinventory-server.conf' ([y]/n) ? ENTER
Do you wish to setup Administration Server (Web Administration Console)
on this computer ([y]/n)? ENTER
Administration Server writable/cache directory (by default
/var/lib/ocsinventory-reports), especially if you use deployment feature.
Do you wish to continue ([y]/n)? ENTER
Where to copy Administration Server static files for PHP Web Console
[/usr/share/ocsinventory-reports] ? ENTER
Where to create writable/cache directories for deployment packages,
administration console logs, IPDiscover and SNMP [/var/lib/ocsinventory-reports] ? ENTER
VOILA!
+----------------------------------------------------------------------+
| OK, Administration server installation finished ;-) |
| |
| Please, review /etc/apache2/conf-available/ocsinventory-reports.conf
| to ensure all is good and restart Apache daemon. |
| |
| Then, point your browser to http://server//ocsreports
| to configure database server and create/update schema. |
+----------------------------------------------------------------------+
Agora vamos criar os SYM Links para o OCS config files:
ln -s /etc/apache2/conf-available/ocsinventory-reports.conf /etc/apache2/conf-enabled/ocsinventory-reports.conf
ln -s /etc/apache2/conf-available/z-ocsinventory-server.conf /etc/apache2/conf-enabled/z-ocsinventory-server.conf
chown www-data:www-data -R /var/lib/ocsinventory-reports
Vamos editar agora z-ocsinventory-server.conf e configurar usuários e conexões:
nano /etc/apache2/conf-enabled/z-ocsinventory-server.conf
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 COLOQUE_SUA_SENHA_AQUI
Basta apenas acessar o endereço http://seu_ip/ocsreports
Pronto OCS instalado e configurado, no próximo post vou explicar como instalar o agent.
Espero ter te ajudado!
Até mais!







