Ocs Inventory 2.9
Sobre
Olá! Visitante, reunimos aqui, informações sobre a ferramenta Ocs Inventory ( Open Computers and Software Inventory/Computadores Abertos e Inventário de Software), o que nos possibilita gerir um parque de computadores de maneira simples e com licenciamento baseado em GPL. Com esta ferramenta os gestores de TI podem além de identificar alterações nos softwares e hardwares de sua infra, também podem integrar com a ferramenta GLPI [1] , assim unindo a gestão de ativos com a gestão de chamados, podendo gerar gráficos personalizados afim de criar históricos e estatísticas para gestores, técnicos e terceiros.
Instalação
- Site oficial: https://ocsinventory-ng.org
Vídeo
Instalando dependências
- Debian 11
apt-get install libgdbm-dev libxml-simple-perl perl libperl5.32 libdbi-perl libdbd-mysql-perl libapache-dbi-perl libnet-ip-perl libsoap-lite-perl libswitch-perl php-pclzip php7.4 php7.4-soap php7.4-xml php7.4-gd php7.4-curl php7.4-mysql php7.4-zip libxml-parser-perl build-essential git libconfig-yaml-perl php7.4-mbstring apache2 mariadb-server
Instalar o pacote CPAN manualmente
perl -e shell -MCPAN
Confirme com yes.
- No console do CPAN.
CPAN[1]> install XML::Entities CPAN[2]> install Archive::Zip CPAN[3]> install Mojolicious CPAN[4]> install Plack::Handler CPAN[5]> install Net::IP
Após concluir instalação, digite exit para sair do console do CPAN.
Reinicie o serviço do Apache para que as alterações sejam efetuadas.
/etc/init.d/apache2 restart
Criando o banco de dados ocs no MySQL
mysql -u root -p Enter password: < digite a senha de root que foi definida na instalação do MySQL >
Criar o banco de dados ocsweb
mysql> create database ocsweb character set utf8;
Criar o usuário ocs para o banco ocs
mysql> GRANT ALL PRIVILEGES ON *.* TO ocs@localhost IDENTIFIED BY 'senhasegura' WITH GRANT OPTION; mysql> quit
Instalando OCS 2.9
Download do site https://github.com/OCSInventory-NG/OCSInventory-ocsreports/releases
wget https://github.com/OCSInventory-NG/OCSInventory-ocsreports/releases/download/2.9.2/OCSNG_UNIX_SERVER-2.9.2.tar.gz tar -zxvf OCSNG_UNIX_SERVER_2.9.2.tar.gz cd OCSNG_UNIX_SERVER_2.9.2 sh setup.sh
1 - Which host is running database server [localhost] ? [ENTER] 2 - On which port is running database server [3306] ? [ENTER] 3 - Where is Apache daemon binary [/usr/sbin/apache2ctl] ? [ENTER] 4 - Where is Apache main configuration file [/etc/apache2/apache2.conf] ? [ENTER] 5 - Which user account is running Apache web server [www-data] ? [ENTER] 6 - Which user group is running Apache web server [www-data] ? [ENTER] 7 - Where is Apache Include configuration directory [/etc/apache2/conf-available] ? /etc/apache2/sites-available [ENTER] 8 - Where is PERL interpreter binary [/usr/bin/perl] ? [ENTER] 9 - Do you wish to setup Communication server on this computer ([y]/n)? [ENTER] 10 - Where to put Communication server log directory [/var/log/ocsinventory-server] ? [ENTER] 11 - Where to put Communication server plugins configuration files [/etc/ocsinventory-server/plugins] ? [ENTER] 12 - Where to put Communication server plugins Perl modules files [/etc/ocsinventory-server/perl] ? [ENTER] 13 - Do you wish to continue ([y]/n] ? [ENTER] 14 - Do you wish to setup Rest API server on this computer ([y]/n)? [ENTER] 15 - Where do you want the API code to be store [/usr/local/share/perl/5.24.1] ? [ENTER] 16 - to 'z-ocsinventory-server.conf' ([y]/n) ? [ENTER] 17 - Do you wish to setup Administration Server (Web Administration Console) on this computer ([y]/n)? [ENTER] 18 - Do you wish to continue ([y]/n)? [ENTER] 19 - Where to copy Administration Server static files for PHP Web Console [/usr/share/ocsinventory-reports] ? [ENTER] 20 - Where to create writable/cache directories for deployment packages,administration console logs, IPDiscover and SNMP [/var/lib/ocsinventory-reports]? [ENTER]
Ajustes no php.ini
- Para PHP 7.4
nano /etc/php/7.4/apache2/php.ini
- Parâmetros a serem alterados:
max_execution_time = 200 max_input_time = 200 memory_limit = 512M post_max_size = 128M upload_max_filesize = 128M
Ajustando parâmetros do OCS
nano /etc/apache2/sites-available/ocsinventory-reports.conf
- Parâmetros a serem alterados:
php_value post_max_size 128m php_value upload_max_filesize 128m
nano /etc/apache2/sites-available/z-ocsinventory-server.conf
- Parâmetros a serem alterados:
#PerlSetVar OCS_DB_PWD ocs PerlSetVar OCS_DB_PWD senhasegura
Criando Links Simbólicos para o Apache
ln -s /etc/apache2/sites-available/z-ocsinventory-server.conf /etc/apache2/sites-enabled/ ln -s /etc/apache2/sites-available/zz-ocsinventory-restapi.conf /etc/apache2/sites-enabled/ ln -s /etc/apache2/sites-available/ocsinventory-reports.conf /etc/apache2/sites-enabled/ /etc/init.d/apache2 restart
- Ajustando dono da pasta reports para Debian 11
chown www-data:www-data -R /var/lib/ocsinventory-reports/
Pós instalação
- realizar este comando, somente após acessar o OCS através da WEB (http://IPDOSERVER/ocsreports) e realizar o wizard da instalação, caso contrário irá abrir apenas uma página em branco, pois o servidor não irá encontrar o arquivo (install.php) para fazer o processo de ajuste de banco de dados e fazer o setup do OCS.
rm /usr/share/ocsinventory-reports/ocsreports/install.php
Instalando Agentes
- Conforme Documentação oficial
https://wiki.ocsinventory-ng.org/03.Basic-documentation/Setting-up-the-Windows-Agent-2.x-on-client-computers/
- Download do Agent
https://github.com/OCSInventory-NG/WindowsAgent/releases
- Download do PSExec:
https://docs.microsoft.com/pt-br/sysinternals/downloads/psexec
Exemplo com PSExec
psexec \\* -s -u Dominio\Administrator -p SENHA \\Server\NetLogon\OCS-NG-Windows-Agent-Setup.exe /S /NOSPLASH /SERVER=http://IP_DO_OCS/ocsinventory