ocs inventory debian installation. Inventory of computer and office equipment


Today, in an organization of any size, there is quite a lot of computer equipment and other equipment. Accounting for which, as well as other related costs, is often the responsibility of the administrator. The use of specialized systems can greatly simplify this task. In this article, we will look at OCS Inventory NG and GLPI solutions, which are a good alternative to proprietary products.

Features of OCS Inventory NG and GLPI

The OCS Inventory NG system (OCSNG, Open Computers and Software Inventory New Generation) is designed to inventory computers on a local network, components and software. It can also be used to remotely deploy programs to workplaces and obtain information about the network configuration. GLPI (Gestion Libre de Parc Informatique), in addition to the tasks of accounting for computers and their components, allows you to inventory other equipment, including consumables (for example, cartridges), as well as organize a technical support service by automating the processing of user requests. Now the user, instead of running or calling the admin, fills out an application by going to the address of the resource. Requests are processed according to their importance or in order of priority. The administrator wins in doubly - all appeals are documented, and you can safely report to your superiors about the work done and the time spent, users for the same reason will stop applying for trifles. Not to mention that calls usually distract from the current work. Also, with its help, you can create a knowledge base, which will consist of notes, articles and FAQs, keep records of suppliers, contracts. A large number of reports (on contracts, financial, for the year) and statistics (on applications, equipment, elements) are available.
Calendar synchronization is supported by Ical, Webcal protocols.
GLPI functionality can be extended with a wide range of third party plugins!
Both systems are Russified (with some reservations) and distributed under the GNU GPL license.
In GLPI, as in the original, all data is entered manually and stored in the MySQL database. Then the administrator using a web form can select any information of interest to him. Starting from version 0.65, GLPI supports data synchronization with OCSNG databases, and this does not require any additional modules. Although if the network already has a Nagios or Cacti server, then data on computers and other equipment can be imported from there as well.
The main advantage of OCS Inventory NG is that an agent program is used to collect information about installed equipment from client computers and servers. All collected data is sent by the agents to the management server as an XML stream compressed with Zlib, the standard HTTP/HTTPS protocol is used for transmission. The OCSNG server consists of 4 components that can be installed on one or more computers:

  • database - used to store information, supported by MySQL from 4.1;
  • communication service - provides HTTP communication between the database server and agent programs, requires Apache Web Server 1.3.X / 2.X with integrated Perl (in Debian / Ubuntu package libapache-dbi-perl);
  • deployment service - designed to store the installation files of agent programs, any web server with SSL support is suitable;
  • management console - view the collected data in a browser, requires a web server with PHP support (with ZIP and GD activated).

The OCSNG server part can be installed on a computer running Windows 2000 Professional/Server, XP Professional Edition and 2003, as well as Linux, FreeBSD, OpenBSD, NetBSD, Solaris, IBM AIX and MacOS X. The agent is available for client and server versions of Windows from 95 to Server 2008 R2, as well as the listed Linux (2.4/2.6, x86, x86_64/AMD64, Sparc64, ARM, PowerPC), MacOS X (10.3 - 10.5), FreeBSD/OpenBSD/NetBSD (x86/Sparc), Solaris 8, 9, 10 (x86/Sparc), IBM AIX (5.1 - 5.3) and HP-UX.
It should be noted that one of the shortcomings of both this project and the GLPI project is the small amount of documentation. Although, understanding the essence of the process, it is quite simple to deal with all the nuances.

Installing OCS Inventory on Ubuntu

In mid-April, after more than a year of development, a new version 1.02 of OCSNG was released, which will be discussed later. The OCSNG package is available in the repositories of many distributions. For example, we will choose Ubuntu 8.04 LTS as a server and client. Check what is in the Ubuntu repository.

$ sudo apt-cache search ocsinventory ocsinventory-reports - Hardware and software inventory tool (Administration Console) ocsinventory-server - Hardware and software inventory tool (Communication Server) ocsinventory-agent - Hardware and software inventory tool (client)

Although this is not the most up-to-date version at the moment:

$ sudo apt-cache show ocsinventory-server | grep -i version Version: 1.01-3 $ sudo apt-cache show ocsinventory-agent | grep -i version Version: 1:0.0.8-1

Therefore, we will install using the source texts. The dependencies of the “ocsinventory-server” package, obtained with “sudo apt-cache depends ocsinventory-server”, lists Apache2 and some Perl modules, a utility for modifying the ucf configuration files, and dbconfig-common. The MySQL package is listed as an optional dependency, so install it separately.

$ sudo apt-get install mysql-server

$ sudo apt-get build-dep ocsinventory-server

In this case, it is useless, so we install everything that is necessary manually:

$ sudo apt-get install libapache2-mod-perl2 libdbi-perl libapache-dbi-perl libdbd-mysql-perl libsoap-lite-perl libxml-simple-perl libnet-ip-perl libcompress-zlib-perl php5-gd

Download the OCSNG_UNIX_SERVER-1.02.tar.gz archive from the OCSNG project website and install:

$ tar xzfv OCSNG_UNIX_SERVER-1.02.tar.gz $ cd ./OCSNG_UNIX_SERVER-1.02/ $ sudo ./setup.sh

During installation, you should answer a number of standard questions: the location of the database server, the executable and configuration file of the web server, the user under which the web server is running, and so on. In most cases, the script itself finds everything you need and it's enough just to confirm the parameter. The only thing he did not figure out was the user and group on behalf of which Apache is started. Therefore, instead of the suggested
[$(APACHE_RUN_USER)] specify www-data.
The next step is to check installed Perl modules. And if the desired one is not found, a corresponding message is displayed. For example, the XML::Entities module is not listed in the Ubuntu dependencies.

Checking for XML::Entities PERL module... *** Warning: PERL module XML::Entities is not installed !

There is no package in the repository that provides the XML::Entities functionality, so you have to install it yourself from CPAN.

$ sudo cpan -i XML::Entities

And repeat the installation. Upon completion, the script will offer to install the administration console.
During the installation process, configuration files for the web server will be created in the /etc/apache2/conf.d/ directory - ocsinventory-server.conf and ocsinventory-reports.conf.
The PHP scripts themselves that provide the OCSNG functions will be copied to /usr/share/ocsinventory-reports/ocsreports and connected to the web server using the Alias ​​directive:

$ cat ocsinventory-reports.conf | grep -i alias # Alias ​​used to put Administration Server static page (typically PHP) outside Alias ​​/ocsreports /usr/share/ocsinventory-reports/ocsreports # Alias ​​to put Deployement package files outside Apache document root directory Alias ​​/download /var/lib /ocsinventory-reports/download

Therefore, if it is necessary to control access, all changes should be made in the mentioned configuration files, otherwise the rights assigned to the root will not be inherited.
In addition, a file is created that rotates the logs once a week.

$ cat /etc/logrotate.d/ocsinventory-server # Rotate OCS Inventory NG Communication server logs daily # Save 7 days old logs in compressed mode /var/log/ocsinventory-server/*.log ( daily rotate 7 compress missingok )

When finished, restart the web server.

$ sudo /etc/init.d/apache2 force-reload

Some packages distributed using OCSNG can be larger than 8 MB, so in order to avoid problems with their download, you should set the post_max_size and upload_max_filesize variables in the /etc/php5/apache2/php.ini file to a larger value, for example, 10 MB (default - 8 and 2 MB). The same settings should be changed in ocsinventory-reports.conf:

php_value post_max_size 10m php_value upload_max_filesize 10m

We type in the browser http://localhost/ocsreports/install.php and in the window that appears, enter the login and password to access MySQL. By default, during the installation process, the “ocs” account with the password “ocs” will be created to access the ocsweb database. Unless access to the database is restricted to the local system, the password should be changed for security purposes.

$ mysql -uroot -prootsecret mysql> UPDATE mysql.user SET Password = PASSWORD("ocspasswd") WHERE User = "ocs"; mysql> FLUSH PRIVILEGES; mysql> exit

The new password value should be written in the /usr/share/ocsinventory-reports/ocsreports/dbconfig.inc.php file:

$_SESSION["PSWD_BASE"]="ocspasswd"

And in ocsinventory-server.conf:

PerlSetVar OCS_DB_PWD ocspasswd

Localization

We go to the page http://localhost/ocsreports/, for registration we use the login “admin” with the password “admin”. By clicking on the flag here, you can activate the Russian interface language, but immediately after installation, this led to the appearance of unreadable characters. The only material on the localization of the OCS Inventory interface is an article by Evgeny Brazhko (http://eugene-online.blogspot.com/2008/04/ocs-inventory.html), but it refers to version 1.02RC1, released in March 2008, and many the issues that are described in it have already been resolved in the current version. So the analysis of the HTML code of the page showed that it is issued in the desired encoding:

The interface is localized using the russian.txt language file located in /usr/share/ocsinventory-reports/ocsreports/languages. In the “Configurations” menu there is a separate item “Language file” that allows you to edit it. But opening the russian.txt file in a text editor that supports CP1251, we find only a set of unreadable characters. File command output:

$ file russian.txt russian.txt: UTF-8 Unicode English text

Asks even more questions. Wherein:

$ file english.txt english.txt: ASCII English text

And the first line of the file clearly indicates the desired encoding.

$ head -n 1 russian.txt 0 windows-1251

From this we conclude that something is wrong with the file itself, so we take a similar one with RC1 or , and replace it, not forgetting to set the necessary access rights.

$ sudo chown root:www-data russian.txt

After that, all inscriptions are displayed in Russian.
To correctly display the names of programs installed on Windows systems, you should set the value “UTF8_DEGREE” to “1” in the /usr/share/ocsinventory-reports/ocsreports/preferences.php file:

Define("UTF8_DEGREE", 1); // 0 For non utf8 database, 1 for utf8

Echo "$td3".htmlentities(textDecode($item->PUBLISHER))." $td3".htmlentities(textDecode($item->NAME))." $td3".textDecode($item->VERSION)." $td3".(htmlentities(textDecode($item->COMMENTS))?htmlentities(textDecode($item->COMMENTS)):"N/A")." ";

Change to:

Echo "$td3".textDecode($item->PUBLISHER)." $td3".textDecode($item->NAME)." $td3".textDecode($item->VERSION)." $td3".(htmlentities (textDecode($item->COMMENTS))?textDecode($item->COMMENTS):"N/A")." ";

After that, the list of programs installed on a particular computer will be displayed correctly. The PDF page created using the "Print this page" button, which is located at the very bottom, also looked correct. Although in the general list of software there will still be unreadable text.

Agent installation

The Windows Agent is written in C++ and can be installed manually using a logon script or GPO rules. The agent for Linux is written in Perl and C. To install it, you will need some Perl modules (XML and Zlib) and dmidecode (provides collection of data from the BIOS about the hardware in accordance with the SMBIOS/DMI standards). On Linux, the agent is installed manually. Let's look at this option first.
If the client is installed on the same computer as the server, almost all the necessary packages to satisfy the dependencies will already be there. Otherwise, install:

$ sudo apt-get install libcompress-zlib-perl libnet-ip-perl libnet-ssleay-perl libwww-perl libxml-simple-perl po-debconf ucf dmidecode pciutils

$ tar xzvf OCSNG_UNIX_AGENT-1.02.tar.gz $ cd Ocsinventory-Agent-1.0.1 $ perl Makefile.PL $ make $ sudo make install

After entering the last command, you will be prompted to configure the agent.

Do you want to configure the agent Please enter "y" or "n"?> [y]

We mark “y” and use the number keys to answer the questions where the configuration file should be located:

Where do you want to write the configuration file? 0 -> /etc/ocsinventory 1 -> /usr/local/etc/ocsinventory 2 -> /etc/ocsinventory-agent

Next, we specify the address or name of the server, create a tag (it can be used to assemble systems into a target group, for example, according to the principle of placement) for the agent, activate the task for cron, a directory for storing files, and so on. Upon completion, a request is issued to send the collected data about the computer to the server:

Do you want to send an inventory of this machine? Please enter "y" or "n"?> [y] Accountinfo file doesn't exist. I create an empty one. -> Success!

As a result, a subdirectory with files containing the current computer configuration will be created in /var/lib/ocsinventory-agent. For example, ocsinv.adm contains the tag and name of the system under which it will be visible in the management console.

$ cat /var/lib/ocsinventory-agent/http\:__localhost_ocsinventory/ocsinv.adm TAG Ubuntu

Almost immediately after installing the agent, information about the new system will appear in the management console in the All computers tab.
If problems occur, you can run the agent in debug mode:

$ ocsinventory-agent -l /tmp --debug --server http://localhost/ocsinventory

By default, the “All computers” tab displays 7 characteristics of client machines, but using the “Add column” drop-down list, you can add up to 23 more fields. Although in some cases errors in the definition of parameters are noticed. So on a system with the following characteristics:

$dmesg | grep -i processor [ 97.725563] powernow-k8: Found 1 AMD Athlon(tm) 64 X2 Dual Core Processor 3600+ processors (2 cpu cores) (version 2.20.00) [ 0.000000] Detected 2010.408 MHz processor.

In the OCS Inventory console, it was displayed - 1000 MHz, but if necessary, the data can be corrected manually. For various reasons, a computer can be entered into the database several times; to remove duplicates, there is a tab with the same name in which identical systems can be selected according to several characteristics (name, MAC address, serial number).
The current version of the agent for Windows is 4.0.5.4, the archive OCSNG_WINDOWS_AGENT_1.02.zip with installation files can be downloaded from the project website. Apparently, a bug has already been fixed in it, which led to the fact that Russian letters starting with 'x' (0xF4) were replaced by English x. In any case, everything worked correctly on test systems. Alternatively, you can use a special assembly (version agent 4.0.4.9).
The simplest installation option is to run the executable file OcsAgentSetup.exe; in this case, a standard installation will be performed, after which the agent will be registered as a service. At the last stage, we specify the name or IP address of the OCSNG server and check the "Immediatly launch inventory" box to immediately send the report.
All settings will be saved in the service.ini file, the directory where the agent is installed.
On Vista, open it and add the /DEBUG option to the startup string:

Miscellaneous= /SERVER:192.168.0.10 /PNUM:80 /DEBUG

When changing hardware or software, force the agent to be called by typing in the command line:

> "C:\Program Files\OCS Inventory Agent\OCSInventory.exe" /SERVER:ocsng_server /PNUM:80 /NOW

Also, the agent (the ocsagent.exe file, which is a zip archive) can be imported into the OCSNG database by selecting the Agent in the tab and pointing to the file location. In this case, it will be available from any computer on the network.


In addition to network inventory functions, OCSNG has the ability to deploy packages and run commands written in a file (eg bat / vbs) on client computers (except Vista), information about which is in the inventory system. If you need to install one application on a large number of systems, this functionality is very helpful.
First you need to create a package. Go to Deployment - Build and fill in the fields New package building. The package name should be unique and preferably reflect its purpose. The Priority parameter determines the order in which packets are placed. What to actually do with the package is determined by the Action field. There are three possible values ​​here:

  • Store - copy to the target system;
  • Execute - copy and execute with a command;
  • Launch - copy and run.

Parameters in User notifications allow you to display an appropriate warning to the user, allow him to cancel the task. The created package is copied to the /var/lib/ocsinventory-reports/download/timestamp directory
In this case, the timestamp is unique.

$ ls /var/lib/ocsinventory-reports/download/ 1241705351 1241722723 $ ls 1241722723 1241722723-1 info

The info file contains the package settings, and 1241722723-1 is the actual program.
Go to Deployment - Activate, select the required package and click the Activate link. In the window that appears, enter the address of the form https://server/download/, while the timestamp will be added to the URL automatically, click “Submit”. In response, you should receive a message:

Package activated, it can now be deployed.

Now we select the computer on which we want to install the package, go to the “Customization” menu, select the “add package” link at the very bottom, point to the package and click in the “Affect” field. We confirm our choice. In Customization, information about the state of the task will appear, and statistics will be displayed in the table in Activate.
By default, the agent connects to the server once a day, then the installation will be performed. You can speed up this process by forcing the connection, as shown above. After the agent connects to the server, the package status should change from WAITING_NOTIFICATIONS to NOTIFIED and then Success. The package will be saved in the C:\Program Files\OCS Inventory Agent\download\TIMESTAMP directory. And all related messages can be found in the download.log file.
In addition to issuing information about “their” computer, agents on different subnets scan the network in search of MAC addresses belonging to other systems. This feature is called “IP discovery” and allows you to find other devices on which the agent cannot be installed (for example, switches, printers, and so on).


Installing GLPI

Installing GLPI is quite simple. The distribution repositories have the required package, but its version is usually far behind.

$ sudo apt-cache search glpi glpi - IT and Asset management software $ sudo apt-cache show glpi | grep -i version Version: 0.68.3.2-1

The current version at the time of writing is 0.71.5, released in January 2009. In addition, a pre-release 0.72-RC2 and a cut of the CVS archive are available on the download page. To install, simply unpack the downloaded archive into the root directory of the web server:

$ sudo tar xzvf glpi-0.71.5.tar.gz -C /var/www $ cd /var/www/glpi

Set the owner and owner group for some directories.

$ sudo chown www-data:www-data config files files/* inc

Next, we type http://localhost/glpi in the browser, select the language (there is Russian in the list), accept the terms of the GPL, and follow the instructions of the installation wizard. The most important step is “Checking the environment for compatibility with GLPI”, where you should carefully read and follow all the recommendations.
For example, at the direction of the wizard, the memory_limit parameter in php.ini should be set to a value greater than 32.

$ grep -i memory_limit /etc/php5/apache2/php.ini memory_limit=128M

We fulfill all the requirements, check again and if everything is fine, click Continue.


Now the actual installation - enter the data for accessing MySQL, the name of the database and that's it.
In order for GLPI to automatically check mail and send notifications, create a task for the user on whose behalf the web server is running (you need the php5-cli package):

$ sudo crontab -u www-data -e */5 * * * * /usr/bin/php5 /var/www/glpi/front/cron.php &>/dev/null

By default, GLPI creates four accounts with different rights and capabilities (a password is specified through a fraction):

  • glpi/glpi - administrator;
  • tech/tech - technical specialist;
  • normal/normal - normal account (the ability to view data);
  • post-only / post-only - only contacting the support service;

GLPI supports importing credentials from AD or other LDAP.
We register in the system as glpi. To localize the interface in “Setting - Select Language”, select Russian, after which all new accounts will use the selected language by default. New users are added in the tab of the same name, there is a somewhat incorrect translation. Since the login corresponds to the "Username" field, this is sometimes confusing. To avoid confusion, you can change the value in the /var/www/glpi/locales/ru_RU.php file:

$LANG["setup"]="Username";

Next, go to “Setup - General setup” and set “Activate OCSNG mode” to “Yes”. After that, a new tab “OCSNG Mode” (OCSNG Mode) will appear. If OCSNG and MySQL are installed on the local machine, then the data for connecting to OCSNG will be found automatically. Otherwise, you will need to fill in the OCSNG server information manually.


By default, only a part of the parameters are synchronized, in order for computer components to be transferred to the GLPI database, they should be synchronized by setting the checkbox next to the one you need in the “Global import” position.
In addition, the “OCSNG” item will appear in the “Tools” tab. Using the links available here, you can synchronize and import computers between OCSNG and GLPI.
The received data appears in the Hardware tab. Here, several sub-items, switching to some of them allows you to get a list of some components included in the computer (Monitors, Printers), individual equipment (Cartridges, Phones), as well as software. Imported computers are available in the sub-item of the same name. By selecting a computer or device, we get access to 12 tabs in which we can view and correct equipment data, match the responsible person, view requests, add notes, mark the issue for temporary use, view history, and so on. Unfortunately, at the moment, the list of computer components imported from OCSNG written in Russian is displayed in unreadable text.
GLPI users can be combined into groups, in addition, there is a more global concept - Organization. Immediately after installation, a "Main organization" is created, in which all components will be included. The creation of other organizations with the establishment of subordination between them (structures) is envisaged. But working with organizations is implemented inconveniently, so transferring equipment to another organization is complicated and inconvenient. Data export to PDF, CVS and SLK (Symbolic Link) is provided.
By default, when exporting to PDF, question marks are displayed instead of Russian letters, this happens for two reasons: the standard function exports data in ISO-8859-1 encoding, which is supported by the default font. The hint was found on the OPENNET forum. We replace the utf8_decode function call with utf8_decode_cyr in the /var/www/glpi/inc/export.function.php script.

$ sudo perl -p -i -e "s/utf8_decode/utf8_decode_cyr/g" export.function.php inc/export.function.php:

Now the font. The Helvetica font is used by default for export, which I would recommend leaving. If you replace the font with another, its name will have to be edited in more than two places in the export.function.php file.

$ cat export.function.php | grep -i selectFont $pdf->selectFont(GLPI_ROOT."/lib/ezpdf/fonts/Helvetica.afm");

But also in 2 files located in lib/ezpdf.

Now the font. To convert a TTF font to Postscript type 1, you will need the ttf2pt1 utility.

$ sudo apt-get install ttf2pt1

We launch.

$ ttf2pt1 -l cyrillic -A Helvetica.ttf Helvetica

Now we copy the files instead of the old ones, not forgetting to correct the rights.

$ sudo cp -v Helvetica* /var/www/glpi/lib/ezpdf/fonts/ `Helvetica.afm" -> `/var/www/glpi/lib/ezpdf/fonts/Helvetica.afm" `Helvetica.t1a" -> `/var/www/glpi/lib/ezpdf/fonts/Helvetica.t1a" `Helvetica.ttf" -> `/var/www/glpi/lib/ezpdf/fonts/Helvetica.ttf"

.
After that, the PDF will be displayed correctly.


Installing plugins for GLPI is done by simple unpacking into the glpi/plugins subdirectory, after which the plugin will be available for configuration in the “Settings – Plugins” menu. About 50 different plugins can be downloaded from the project site.

The interfaces of both OCSNG and GLPI are quite easy to learn, just spend half an hour and you will be well versed. Unfortunately, the issue of localization has not been fully resolved. So for Windows in OCSNG, the Cyrillic names of installed programs and hardware components are incorrectly displayed. A discussion of all localization issues can be found on the OCSNG and OPENNET project forums, some of them help, some cannot solve everything.

OCS Inventory NG stands for Open Computers and Software Inventory. This software is designed to inventory computers on the network, collect information about software and installed hardware.

Congratulations to the contestant

This text was submitted to the writing competition that we launched in the spring. We dealt with a large number of incoming materials, summed up the results and awarded the winners. The author of this note received a prize - a three-month subscription to "Hacker". Congratulations!

Key features:

  • convenient web interface;
  • extension of possibilities by plug-ins;
  • IpDiscover and SNMP support;
  • advanced search;
  • collection of Windows and Office keys;
  • remote package deployment.

This product supports all popular operating systems: Windows, Linux, BSD, Sun Solaris, IBM AIX, HP-UX, macOS, Android.

We will install from the official site, since there are old versions in the Debian repositories.

On such a hardware configuration, the server can easily collect information from 150 agents with an update interval of four hours.

  • Soft: Debian Jessie (8.7.1) x64, OCSNG_UNIX_SERVER-2.3.1, OCSNG-Windows-Agent-2.3.0.0
  • VPS: OpenVZ, 2 vCPU, 512 MB, 15 GB SSD

Preparation

Check the date and time to match our timezone. On some virtual servers, they are installed incorrectly, which is why they are displayed incorrectly in the database.

Date ln -sf /usr/share/zoneinfo/Europe/Moscow /etc/localtime

We connect the repository. Open the list of mirrors and add the DotDeb repository.

Nano /etc/apt/sources.list DotDeb deb http://packages.dotdeb.org jessie all deb-src http://packages.dotdeb.org jessie all

Import the DotDeb key:

Wget http://www.dotdeb.org/dotdeb.gpg -O - -q | apt key add-

Update the list of mirrors and packages:

apt-get update && apt-get upgrade

Install the necessary packages:

apt-get install make apache2 php7.0-mbstring php7.0-soap php7.0-common libapache2-mod-php7.0 php-pear php7.0-cli php7.0-ldap php7.0-gd php7.0- zip mariadb-server php7.0-mysqlnd php7.0-curl

During installation, we set a password for the MySQL root user.

Install Perl modules:

apt-get install libxml-simple-perl libio-compress-perl libdbi-perl libdbd-mysql-perl libapache-dbi-perl libnet-ip-perl libsoap-lite-perl libarchive-zip-perl cpan -i XML::Entities

After that, install MariaDB and create the ocs user and the ocsweb database.

Login to the database:

MySQL -u root -p

Create a user:

Mysql> create user "ocs"@"localhost" identified by "pass_mysql";

Create a database:

mysql> create database `ocsweb` character set = "utf8";

Assign rights:

Mysql> GRANT ALL PRIVILEGES ON `ocsweb`.* to `ocs`@localhost; mysql> FLUSH PRIVILEGES; mysql>quit;

Installation and setup

Download OCS-NG Server:

Wget -P /tmp https://github.com/OCSInventory-NG/OCSInventory-ocsreports/releases/download/2.3.1/OCSNG_UNIX_SERVER-2.3.1.tar.gz tar -xf /tmp/OCSNG_UNIX_SERVER-2.3.1. tar.gz -C /tmp cd /tmp/OCSNG_UNIX_SERVER-2.3.1/

Run the installation script (leave all settings by default):

./setup.sh

  1. We are confident and want to continue.
  2. Our MySQL server is running on localhost.
  3. And it works on port 3306.
  4. The apache2 daemon binary is located in /usr/sbin/apache2ctl .
  5. The configuration file is located here: /etc/apache2/apache2.conf .
  6. Apache2 runs as user www-data .
  7. Which is part of the www-data group.
  8. The installer will place the OCS Inventory NG configuration file in the /etc/apache2/conf-available directory.
  9. The PERL binary is located here: /usr/bin/perl .
  10. Yes, we want to set up a configuration server on this computer.
  11. We place the OCS server logs in /var/log/ocsinventory-server .
  12. Plugin configuration files will be located here: /etc/ocsinventory-server/plugins.
  13. Set the location of Perl modules: /etc/ocsinventory-server/perl .
  14. Apache2::SOAP PERL module not installed, do you want to continue? (This is an optional OCS feature, without it everything will work correctly.)
  15. To have Apache 2 load Perl modules before OCS starts, the installer will rename ocsinventory-server.conf to z-ocsinventory-server.conf .
  16. Yes, we want to set up the Web Administration Console.
  17. Our version of OCS is being installed for the first time, so let's continue.
  18. Where to copy PHP Web Console static files to /usr/share/ocsinventory-reports .
  19. Writable/cached directories for deployment packages, as well as admin console, IpDiscover, and SNMP logs will be in /var/lib/ocsinventory-reports .
  20. Ready! We do not restart the web server yet. The installation log is /tmp/OCSNG_UNIX_SERVER-2.3.1/ocs_server_setup.log .

We set the PerlSetVar directive OCS_DB_PWD in z-ocsinventory-server.conf , that is, the password of the user ocs.

Nano /etc/apache2/conf-available/z-ocsinventory-server.conf PerlSetVar OCS_DB_PWD pass_mysql

Enable configs

a2dissite 000-default a2enconf ocsinventory-reports a2enconf z-ocsinventory-server /etc/init.d/apache2 restart

We grant the www-data user rights to directories:

Chown -R www-data:www-data /usr/share/ocsinventory-reports/ chmod 0755 /var/lib/ocsinventory-reports/

Now connect to http://domen_or_ip/ocsreports . We will be notified that we should get rid of install.php . Delete it:

Rm /usr/share/ocsinventory-reports/ocsreports/install.php

Additionally, you can disable AccessLog in Apache 2:

Nano /etc/apache2/sites-available/000-default.conf

Sergey Yaremchuk

Equipment inventory with OCS Inventory NG and GLPI

Today, any organization has a lot of computer equipment and other equipment, accounting for which, as well as other related costs, is often the responsibility of an administrator. The use of specialized systems can greatly simplify this task. In this article, we will look at OCS Inventory NG and GLPI solutions, which are a good alternative to proprietary products.

Features of OCS Inventory NG and GLPI

The OCS Inventory NG (OCSNG, Open Computers and Software Inventory New Generation) system is designed to inventory computers on a local network, components and software. It can also be used to remotely deploy programs to workplaces and obtain information about the network configuration.

GLPI (Gestion Libre de Parc Informatique), in addition to the tasks of accounting for computers and their components, allows you to inventory other equipment, including consumables (for example, cartridges), as well as organize a technical support service, automating the processing of user requests. Now the user, instead of running or calling the admin, fills out an application by going to the address of the resource. Requests are processed according to their importance or in order of priority. The administrator wins doubly - all requests are documented, and you can safely report to your superiors about the work done and the time spent, users for the same reason will stop contacting for trifles. Not to mention that calls usually distract from the current work.

Also, with its help, you can create a knowledge base, which will consist of notes, articles and FAQs, keep records of suppliers, contracts. A large number of reports (on contracts, financial, for the year) and statistics (on applications, equipment, elements) are available.

Calendar synchronization is supported by Ical, Webcal protocols. GLPI functionality can be extended with a wide range of third party plugins!

Both systems are Russified (with some reservations) and distributed under the GNU GPL license.

In GLPI, like in Kwok Information Server, initially all data is entered manually and stored in a MySQL database. Then the administrator using a web form can select any information of interest to him. Starting from version 0.65, GLPI supports data synchronization with OCSNG databases, and this does not require any additional modules. Although if the network already has a Nagios or Cacti server, then data on computers and other equipment can be imported from there as well.

The main advantage of OCS Inventory NG is that an agent program is used to collect information about installed equipment from client computers and servers. All collected data is sent by the agents to the management server as an XML stream compressed with Zlib, the standard HTTP/HTTPS protocol is used for transmission.

The OCSNG server consists of 4 components that can be installed on one or more computers:

  • database– used to store information, supported by MySQL from 4.1;
  • communication service– provides HTTP communication between the database server and agent programs, requires Apache Web Server 1.3.X/2.X with integrated Perl (libapache-dbi-perl package in Debian/Ubuntu);
  • deployment service- designed to store the installation files of agent programs, any web server with SSL support is suitable;
  • management console– viewing the collected data in a browser, requires a web server with PHP support (with ZIP and GD activated).

The OCSNG server part can be installed on a computer running Windows 2000 Professional/Server, XP Professional Edition, and 2003, as well as Linux, FreeBSD, OpenBSD, NetBSD, Solaris, IBM AIX, and MacOS X.

The agent is available for client and server versions of Windows from 95 to Server 2008 R2, as well as the listed Linux (2.4/2.6, x86, x86_64/AMD64, Sparc64, ARM, PowerPC), MacOSX (10.3-10.5), FreeBSD/OpenBSD/ NetBSD (x86/Sparc), Solaris 8, 9, 10 (x86/Sparc), IBM AIX (5.1-5.3) and HP-UX.

It should be noted that one of the shortcomings of both this project and the GLPI project is the small amount of documentation. Although, understanding the essence of the process, it is quite simple to understand the nuances.

Installing OCS Inventory on Ubuntu

In mid-April, after more than a year of development, a new version 1.02 of OCSNG was released, which will be discussed later. The OCSNG package is available in the repositories of many distributions. For example, we will choose Ubuntu 8.04 LTS as a server and client.

Check what is in the Ubuntu repository.

$ sudo apt-cache search ocsinventory

$ sudo apt-cache show ocsinventory-agent | grep -i version

Version: 1:0.0.8-1

Therefore, we will install using the source texts. In the dependencies of the ocsinventory-server package, obtained using the command:

$ sudo apt-cache depends ocsinventory-server

Apache2 and some Perl modules are listed, a utility for modifying ucf configuration files and dbconfig-common. The MySQL package is listed as an optional dependency, so install it separately:

$ sudo apt-get install mysql-server

Command:

$ sudo apt-get build-dep ocsinventory-server

in this case is useless, so we install everything that is necessary manually:

$ sudo apt-get install libapache2-mod-perl2 libdbi-perl libapache-dbi-perl libdbd-mysql-perl libsoap-lite-perl libxml-simple-perl libnet-ip-perl libcompress-zlib-perl php5-gd

Download the OCSNG_UNIX_SERVER-1.02.tar.gz archive from the OCSNG project website and install:

$ tar xzfv OCSNG_UNIX_SERVER-1.02.tar.gz

$ cd ./OCSNG_UNIX_SERVER-1.02/

$ sudo ./setup.sh

During installation, you should answer a number of standard questions: the location of the database server, the executable and configuration file of the web server, the user under which the web server is running, and so on.

In most cases, the script itself finds everything you need and it's enough just to confirm the parameter. The only thing he didn't figure out was the user and group under which Apache is started. Therefore, instead of the proposed [$(APACHE_RUN_USER)] we specify www-data.

Checking for XML::Entities PERL module...

*** Warning: PERL module XML::Entities is not installed !

There is no package in the repository that provides the XML::Entities functions, so you must install it yourself from CPAN:

$ sudo cpan -i XML::Entities

And repeat the installation. Upon completion, the script will offer to install the administration console.

During the installation process, configuration files for the web server will be created in the /etc/apache2/conf.d/ directory - ocsinventory-server.conf and ocsinventory-reports.conf.

The PHP scripts themselves that provide the OCSNG functions will be copied to /usr/share/ocsinventory-reports/ocsreports and connected to the web server using the Alias ​​directive:

$ cat ocsinventory-reports.conf | grep -i alias

# Alias ​​used to put Administration Server static page (typically PHP) outside

Alias ​​/ocsreports /usr/share/ocsinventory-reports/ocsreports

# Alias ​​to put Deployement package files outside Apache document root directory

Alias ​​/download /var/lib/ocsinventory-reports/download

Therefore, if it is necessary to control access, all changes should be made in the mentioned configuration files, otherwise the rights assigned to the root will not be inherited.

In addition, a file is created that rotates the logs once a week.

$ cat /etc/logrotate.d/ocsinventory-server

# Rotate OCS Inventory NG Communication server logs daily

# Save 7 days old logs in compressed mode

/var/log/ocsinventory-server/*.log (

daily

rotate 7

compress

missingok

When finished, restart the web server:

$ sudo /etc/init.d/apache2 force-reload

Some packages distributed using OCSNG can be larger than 8 MB, so to avoid problems with their download, you should set the post_max_size and upload_max_filesize variables in the /etc/php5/apache2/php.ini file to a larger value, for example, 10 MB (default - 8 and 2 MB):

php_value post_max_size 10m

php_value upload_max_filesize 10m

The same settings must be changed in the ocsinventory-reports.conf file.

We type in the browser http://localhost/ocsreports/install.php and in the window that appears, enter the login and password to access MySQL. By default, during the installation process, an ocs account with a password of ocs will be created to access the ocsweb database. Unless access to the database is limited to the local system, then for security reasons the password should be changed:

$ mysql -uroot -prootsecret

mysql> UPDATE mysql.user SET Password = PASSWORD("ocspasswd") WHERE User = "ocs";

mysql> FLUSH PRIVILEGES;

mysql> exit

The new password value should be written in the file /usr/share/ocsinventory-reports/ocsreports/dbconfig.inc.php:

$_SESSION["PSWD_BASE"]="ocspasswd"

And in ocsinventory-server.conf:

PerlSetVar OCS_DB_PWD ocspasswd

Localization

We go to the page http://localhost/ocsreports, for registration we use the login admin with the password admin. By clicking on the flag here, you can activate the Russian interface language, but immediately after installation, this led to the appearance of unreadable characters.

The only material on the localization of the OCS Inventory interface is the article by Evgeny Brazhko, but it refers to version 1.02RC1, released in March 2008, and many issues that are described in it have already been resolved in the current version. So, the analysis of the HTML code of the page showed that it is issued in the required encoding:

The interface is localized using the russian.txt language file located in /usr/share/ocsinventory-reports/ocsreports/languages. The Configurations menu has a separate Language file item that allows you to edit it. But opening the russian.txt file in a text editor that supports СР1251, we find only a set of unreadable characters.

File command output:

$ file english.txt

And the first line of the file clearly indicates the desired encoding.

$ head -n 1 russian.txt

0 windows-1251

We conclude from this that something is wrong with the file itself, so we take a similar one from RC1 or another source (for example, on the magazine's website in the "Source code" section) and replace it, not forgetting to set the necessary access rights.

$ sudo chown root:www-data russian.txt

After that, all inscriptions are displayed in Russian.

To correctly display the names of programs installed on Windows systems, you should set the UTF8_DEGREE value to "1" in the /usr/share/ocsinventory-reports/ocsreports/preferences.php file:

// 0 For non utf8 database, 1 for utf8

define("UTF8_DEGREE", 1);

echo "$td3".htmlentities(textDecode($item->PUBLISHER))."

$td3".htmlentities(textDecode($item->NAME))."

$td3".textDecode($item->VERSION)."

$td3".(htmlentities(textDecode($item->COMMENTS))? ?htmlentities(textDecode($item->COMMENTS)): "N/A")."";

Change to:

echo "$td3".textDecode($item->PUBLISHER)."

$td3".textDecode($item->NAME)."

$td3".textDecode($item->VERSION)."

$td3".(htmlentities(textDecode($item->COMMENTS))? textDecode($item->COMMENTS):"N/A")."";

After that, the list of programs installed on a particular computer will be displayed correctly. The PDF page created using the "Print this page" button at the very bottom also looked correct. Although there will still be unreadable text in the general software list.

Agent installation

The Windows Agent is written in C++ and can be installed manually using a logon script or GPO rules. The agent for Linux is written in Perl and C. To install it, you will need some Perl modules (XML and Zlib) and dmidecode (provides collection of data from the BIOS about the hardware in accordance with the SMBIOS/DMI standards). On Linux, the agent is installed manually. Let's look at this option first.

If the client is installed on the same machine as the server, most of the necessary packages to satisfy the dependencies will already be there. Otherwise, install:

$ sudo apt-get install libcompress-zlib-perl libnet-ip-perl libnet-ssleay-perl libwww-perl libxml-simple-perl po-debconf ucf dmidecode pciutils

$ tar xzvf OCSNG_UNIX_AGENT-1.02.tar.gz

$ cd ocsinventory-agent-1.0.1

$ perl Makefile.PL

$make

$ sudo make install

After entering the last command, you will be prompted to configure the agent.

Next, we specify the address or name of the server, create a tag (it can be used to assemble systems into a target group, for example, according to the placement principle) for the agent, activate a cron task, a directory for storing files, and so on. Upon completion, a request is issued to send the collected data about the computer to the server:

Do you want to send an inventory of this machine?

Please enter "y" or "n"?> [y]

Accountinfo file doesn't exist. I create an empty one.

-> Success!

As a result, a subdirectory with files containing the current computer configuration will be created in /var/lib/ocsinventory-agent. For example, ocsinv.adm contains the tag and name of the system under which it will be visible in the management console.

$ cat /var/lib/ocsinventory-agent/http\:__localhost_ocsinventory/ocsinv.adm

TAG

ubuntu

Almost immediately after installing the agent, information about the new system will appear in the management console in the All computers tab.

If problems occur, you can run the agent in debug mode:

$ ocsinventory-agent -l /tmp --debug --server http://localhost/ocsinventory

By default, the All Computers tab displays 7 characteristics of client machines, but you can add 23 more fields using the Add column drop-down list. Although in some cases errors in the definition of parameters are noticed. So, on a system with the following characteristics:

$dmesg | grep -i processor

[ 97.725563] powernow-k8: Found 1 AMD Athlon(tm) 64 X2 Dual Core Processor 3600+ processors (2 cpu cores) (version 2.20.00)

[ 0.000000] Detected 2010.408 MHz processor.

In the OCS Inventory console, it was displayed - 1000 MHz, but if necessary, the data can be corrected manually. For various reasons, a computer can be entered into the database several times; to remove duplicates, there is a tab with the same name, in which identical systems can be selected according to several characteristics (name, MAC address, serial number).

The current version of the agent for Windows is 4.0.5.4, the archive OCSNG_WINDOWS_AGENT_1.02.zip with installation files can be downloaded from the project website. Apparently, it has already fixed a bug that caused Russian letters starting with "x" (0xF4) to be replaced by English x. In any case, everything worked correctly on the test systems. Alternatively, you can use the special assembly OCSNG_WINDOWS_AGENT_1.02_RC2_OTEA.zip (agent version 4.0.4.9) .

The simplest installation option is to run the OcsAgentSetup.exe executable file, in this case a standard installation will be performed, after which the agent will be registered as a service. At the last stage, we specify the name or IP address of the OCSNG server and check the Immediatly launch inventory checkbox to immediately send the report.

All settings will be saved in the service.ini file of the directory where the agent is installed.

On Vista, open it and add the /DEBUG option to the startup line:

Miscellaneous=/SERVER:192.168.0.10 /PNUM:80 /DEBUG

When changing hardware or software, the agent is forced to be invoked by typing in the command line:

> "C:\Program Files\OCS Inventory Agent\OCSInventory.exe" /SERVER:ocsng_server /PNUM:80 /NOW

Also, the agent (the ocsagent.exe file, which is a zip archive) can be imported into the OCSNG database by selecting in the "Agent" tab and specifying the location of the file. In this case, it will be available from any computer on the network.

In addition to the network inventory functions, OCSNG has the ability to deploy packages and run commands written in a file (for example, bat / vbs) on client computers (except Vista), information about which is in the inventory system. If you need to install one application on a large number of systems, this functionality is very helpful.

First you need to create a package. Go to the Deployment -> Build menu and fill in the New package building fields. The package name should be unique and preferably reflect its purpose. The Priority parameter determines the order in which packets are placed. What, in fact, to do with the package, determines the Action field.

There are three possible values ​​here:

  • Store– copy to the target system;
  • Execute– copy and execute with command;
  • Launch- copy and run.

Parameters in User notifications allow you to display an appropriate warning to the user, allow him to cancel the task. The generated package is downloaded to the /var/lib/ocsinventory-reports/download/timestamp directory.

In this case, the timestamp is unique.

$ ls /var/lib/ocsinventory-reports/download/

Now we select the computer on which we want to install the package, go to the Customization menu, select the add package link at the very bottom, point to the package and click in the Affect field. We confirm our choice. In Customization, information about the state of the task will appear, and statistics will be displayed in the table in Activate.

By default, the agent connects to the server once a day, then the installation will be performed. You can speed up this process by forcing the connection, as shown above. After the agent connects to the server, the package status should change from WAITING_NOTIFICATIONS to NOTIFIED and then Success. The package will be saved in the directory C:\Program Files\OCS Inventory Agent\download\TIMESTAMP. And all related messages can be found in the download.log file.

In addition to issuing information about "their" computer, agents on different subnets scan the network in search of MAC addresses belonging to other systems. This feature is called IP discovery and allows you to find other devices on which the agent cannot be installed (for example, switches, printers, and so on).

Installing GLPI

Installing GLPI is quite simple. The distribution repositories have the required package, but its version is usually far behind.

$ sudo apt-cache search glpi

glpi - IT and Asset management software

$ sudo apt-cache show glpi | grep -i version

Version: 0.68.3.2-1

The current version at the time of this writing is version 0.71.5, released in January 2009. In addition, a pre-release 0.72-RC2 and a cut of the CVS archive are available on the download page.

To install, simply unpack the downloaded archive into the root directory of the web server:

$ sudo tar xzvf glpi-0.71.5.tar.gz -C /var/www

$ cd /var/www/glpi

Set the owner and owner group for some directories:

$ sudo chown www-data:www-data config files files/* inc

Next, we type http://localhost/glpi in the browser, select the language (there is Russian in the list), accept the terms of the GPL and follow the instructions of the installation wizard. The most important stage is “Checking the environment for compatibility with GLPI”, where you should carefully read and follow all the recommendations.

For example, according to the instructions of the wizard, the memory_limit parameter in php.ini should be set to a value greater than 32 MB:

$ grep -i memory_limit /etc/php5/apache2/php.ini

memory_limit = 128M

We fulfill all the requirements, check again and, if everything is fine, click Continue. Now the actual installation - we enter the data for accessing MySQL, the name of the database, and that's it.

In order for GLPI to automatically check mail and send notifications, you should create a task for the user on whose behalf the web server is running (you need the php5-cli package):

$ sudo crontab -u www-data -e

*/5 * * * * /usr/bin/php5 /var/www/glpi/front/cron.php &>/dev/null

By default, GLPI creates four accounts with different rights and capabilities (a password is specified through a fraction):

  • glpi/glpi- administrator;
  • tech/tech- Technical Specialist;
  • normal/normal– a regular account (the ability to view data);
  • post-only/post-only- only contacting support.

GLPI supports importing credentials from AD or other LDAP.

We register in the system as glpi. To localize the interface in the Setting -> Select Language menu, select Russian, after which all new accounts will use the selected language by default. New users are added in the tab of the same name, there is a somewhat incorrect translation. So, the login field corresponds to the "Username" field, this is sometimes confusing. To avoid confusion, you can change the value in the /var/www/glpi/locales/ru_RU.php file:

$LANG["setup"]="Username";

If OCSNG and MySQL are installed on the local machine, then the data for connecting to OCSNG will be found automatically. Otherwise, you will need to fill in the OCSNG server information manually.

By default, only a part of the parameters are synchronized, in order for computer components to be transferred to the GLPI database, they should be synchronized by setting the checkbox next to the one you need in the “Global import” position.

In addition, the OCSNG item will appear in the "Tools" tab, using the links available here, you can synchronize and import computers between OCSNG and GLPI.

The received data appears in the "Equipment" tab. There are several sub-items here, going to some of them allows you to get a list of some of the components included in the computer (“Monitors”, “Printers”), individual equipment (“Cartridges”, “Phones”), as well as software. Imported computers are available in the sub-item of the same name.

By selecting a computer or device, we get access to 12 tabs in which we can view and adjust equipment data, match the responsible person, view requests, add notes, make a mark on lending, view history, and so on.

Unfortunately, at the moment, the list of computer components imported from OCSNG, written in Russian, is displayed in unreadable text.

GLPI users can be combined into groups, in addition, there is a more global concept - "Organization". Immediately after installation, a "Main organization" is created, in which all components will be included. The creation of other organizations with the establishment of subordination between them (structures) is envisaged. But working with organizations is implemented inconveniently, so transferring equipment to another organization is complicated and inconvenient. Data export to PDF, CVS and SLK (Symbolic Link) is provided.

By default, when exporting to PDF, instead of Russian letters, question marks are displayed, this happens for two reasons: the standard function exports data in ISO-8859-1 encoding, which is supported by the default font. The hint was found on the OPENNET forum. We replace the utf8_decode function call with utf8_decode_cyr in the /var/www/glpi/inc/export.function.php script:

inc/export.function.php:

Return iconv("UTF-8","Windows-1251",$value);

The Helvetica font is used by default for export, which I would recommend leaving. If you replace the font with another, its name will have to be edited not only in two places in the export.function.php file:

$ cat export.function.php | grep -i selectFont

$pdf->selectFont(GLPI_ROOT."/lib/ezpdf/fonts/Helvetica.afm");

But also in two files located in lib/ezpdf.

$ sudo apt-get install ttf2pt1

We launch:

$ ttf2pt1 -l cyrillic -A Helvetica.ttf Helvetica

Now we copy the files instead of the old ones, not forgetting to correct the rights:

$ sudo cp -v Helvetica* /var/www/glpi/lib/ezpdf/fonts/

`Helvetica.afm" -> `/var/www/glpi/lib/ezpdf/fonts/Helvetica.afm"

`Helvetica.t1a" -> `/var/www/glpi/lib/ezpdf/fonts/Helvetica.t1a"

`Helvetica.ttf" -> `/var/www/glpi/lib/ezpdf/fonts/Helvetica.ttf"

The corrected version of the fonts can be found in the "Source Code" section of the magazine's website. After that, the PDF will be displayed correctly.

Installing plugins for GLPI is done by simple unpacking into the glpi/plugins subdirectory, after which the plugin will be available for configuration in the "Settings -> Plugins" menu. About 50 different plugins can be downloaded from the project site.

Conclusion

The interfaces, both OCSNG and GLPI, are fairly easy to learn, you need to spend half an hour and you will be well versed. Unfortunately, the issue of localization has not been fully resolved. For example, for Windows, OCSNG displays incorrect Cyrillic names of installed programs and hardware components. A discussion of all localization issues can be found on the OCSNG and OPENNET project forums, some of them help, some cannot solve everything.

  1. Project site OCS Inventory NG - http://www.ocsinventory-ng.org . .
  2. Wiki page of the GLPI project in Russian -

I write from memory. Therefore, minor inaccuracies are possible!

MySQL must use 4.1 or 5.0.

MySQL 5.1 - cannot be used - no driver (in my opinion, I don’t remember exactly, p5-DBI under MySQL5.1).

I have MySQL-5.0 and apache 2.2 and several services spin on them, so I will set it up a little differently. I have installed Apache in conjunction with MySQL, PHP and PHP-extension.

Yes, and the database must be translated into InnoDB. (Who does not know, change in my.cnf).

First install mod_perl2 (because apache2)

#ee /usr/local/etc/apache22/httpd.conf

We add a line:

LoadModule perl_module libexec/apache22/mod_perl.so

Let's uncomment the line, because the program will add the configuration file here:

Include etc/apache22/Includes/*.conf

Manually install XML::Entities from CPAN. It's not in the dependencies of the port,

but the program will require you to install it.

#cpan -i XML::Entities

Install ocsinventory-ng

# cd /usr/local/share/ocsinventory-ng

Create directories for the program:

We start the installation.

There is another option, the result is the same:

#cd /usr/ports/net-mgmt/ocsinventory-ng/

# mkdir -p /etc/logrotate.d/ocsinventory-NG

# mkdir /usr/local/www/ocsinventory-NG

#cd OCSNG_UNIX_SERVER-1.02.1/

+———————————————————-+| |

| Welcome to OCS Inventory NG Management server setup ! |

| |+———————————————————-+

CAUTION: If upgrading Communication server from OCS Inventory NG 1.0 RC2 and

previous, please remove any Apache configuration for Communication Server!

Do you wish to continue ([y]/n)?y

Assuming Communication server 1.0 RC2 or previous is not installed

on this computer.

Starting OCS Inventory NG Management server setup from folder /usr/local/share/ocsinventory-ng

Storing log in file /usr/local/share/ocsinventory-ng/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 ?

OK, database server is running on host localhost 😉

On which port is running database server ?

OK, database server is running on port 3306 😉

+———————————————————-+

| Checking for Apache web server daemon… |

+———————————————————-+

Where is Apache daemon binary ?

OK, using Apache daemon /usr/local/sbin/httpd 😉

+———————————————————-+

| Checking for Apache main configuration file… |

+———————————————————-+

Where is Apache main configuration file ?

Here we write it correctly, given that we have Apache2.2 and it is located in apache22:

OK, using Apache main configuration file /usr/local/etc/apache22/httpd.conf 😉

+———————————————————-+

| Checking for Apache user account… |

+———————————————————-+

Which user account is running Apache web server ?

OK, Apache is running under user account www 😉

+———————————————————-+

| Checking for Apache group… |

+———————————————————-+

Which user group is running Apache web server ?

OK, Apache is running under users group www 😉

+———————————————————-+

| Checking for PERL Interpreter… |

+———————————————————-+

Found PERL Interpreter at 😉

Where is PERL Interpreter binary ?

OK, using PERL Intrepreter /usr/bin/perl 😉

Do you wish to setup Communication server on this computer ([y]/n)?

+———————————————————-+

| 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 ?/usr/local/etc/apache22/Include/

OK, Apache Include configuration directory /usr/local/etc/apache22/Include/ found 😉

+———————————————————-+

| Checking for Apache mod_perl version… |

+———————————————————-+

Checking for Apache mod_perl version 1.99_22 or higher

Checking for Apache mod_perl version 1.99_21 or previous

Found that mod_perl2 version 2.9_21 or previous is available.

OK, Apache is using mod_perl2 version 2.9_21 or previous 😉

+———————————————————-+

| Checking for Communication server log directory… |

+———————————————————-+

Communication server can create detailed logs. This log can be enabled

by setting interger value of LOGLEVEL to 1 in Administration console

menu Configuration.

Where to put Communication server log directory ?

OK, Communication server will put logs into directory /var/log/ocsinventory-NG 😉

+———————————————————-+

+———————————————————-+

Checking for DBI PERL module…

Checking for Apache::DBI PERL module…

Found that PERL module Apache::DBI is available.

Checking for Compress::Zlib PERL module…

Found that PERL module Compress::Zlib 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…

'INSTALLSITESCRIPT' is not a known MakeMaker parameter name.

Writing Makefile for Apache::Ocsinventory

+———————————————————-+

| OK, looks good 😉 |

| Preparing Communication server Perl modules… |

+———————————————————-+

+———————————————————-+

| OK, prepare finished 😉 |

| 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 /usr/local/etc/apache22/Include/ocsinventory.conf

+———————————————————-+

| OK, Communication server setup sucessfully finished 😉

| Please review /usr/local/etc/apache22/Include/ocsinventory.conf

| to ensure everything is good. Then restart Apache daemon.

+———————————————————-+

are asked to view the ocsinventory.conf file.

Do you wish to setup Administration server (web administration console)

on this computer ([y]/n)?

+———————————————————-+

| Checking for Apache root document directory... |

+———————————————————-+

Where is Apache root document directory ?/usr/local/www/data/ocsinventory-NG

OK, Apache root document directory is /usr/local/www/ocsinventory-NG 😉

+———————————————————-+

| 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 /usr/local/www/ocsinventory-NG/download.

Creating directory /usr/local/www/ocsinventory-NG/ocsreports.

Copying files to /usr/local/www/ocsinventory-NG/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 /usr/local/share/ocsinventory-ng/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 😉

By polite request, we are restarting APACHE. OCS has already created a config in the directory

APACHE22. It is necessary to add an alias to httpd.conf if OCS did not want to start normally according to the proposed scheme (http://server/ocsreports). However, I recommend editing /usr/local/etc/apache22/Include/ocsinventory.conf. In my opinion, there, by default, the directory options are incorrectly specified, i.e.:

AllowOverride None

order allow,deny

If you don't want to bother, create an alias in httpd.conf:

#ocsinventory-NG

Alias ​​/ocsreports "/usr/local/www/ocsinventory-NG/ocsreports/"

AllowOverride None

order allow,deny

Now we restart APACHE:

#apachectl restart

Some packages distributed with OCSNG may be

more than 8 MB, so we will set a larger value for the post_max_size and upload_max_filesize variables in the php.ini file. The same settings should be changed in ocsinventory-reports.conf:

php_value post_max_size 10m

php_value upload_max_filesize 10m

Check if MySQL root has a password. If not, assign.

# mysqladmin -u root password newpasswd

We type in the browser http://localhost/ocsreports/install.php and in the window that appears

Enter your username and password to access MySQL. Default in progress

installation, an account “ocs” with a password “ocs” will be created to access the ocsweb database.

MySQL login: root

MySql password: newpasswd

MySql HostName: localhost

WARNING: You will not be able to build any auto deployment package with size greater than 8M.

You must raise both post_max_size and upload_max_filesize in your php.ini to correct this.

MySql config file successfully written

Please wait, database update may take up to 30 minutes……………………………………………………………………………………………………… ……………………………………….

Database successfully generated

Database engine checking……………………

ERROR: InnoDB conversion failed, install InnoDB mysql engine support on your server

(Try to uncomment "#skip-innodb" in your mysql config file.)

Reinstall when corrected.

ERROR: HEAP conversion failed, install HEAP mysql engine support on your server

or you will experience severe performance issues.

Database engine successfully updated (21 table(s) altered)

WARNING: files/ocsagent.exe missing, if you do not reinstall the DEPLOY feature won't be available

Table 'files' was empty

No subnet.csv file to import

network net computing. Please wait…

Network netid was computed=>

netmap netid computing. Please wait…

Netmap netid was computed=> 0 successful, 0 were already computed, 0 were not computable

Cleaning orphans…………………

0 orphan lines deleted

Cleaning netmap…

0 netmap lines deleted

Please enter the label of the windows client tag input box:

(Leave empty if you don't want a popup to be shown on each agent launch).

Enter a name and click the "Submit" button

WARNING: You will not be able to build any auto deployment package with size greater than 8M.

You must raise both post_max_size and upload_max_filesize in your php.ini to correct this.

Installation finished you can log in index.php with

Click here to enter OCS-NG GUI

Do not forget to click on the Russian flag, enter

Default login is admin

default password is admin

And we observe the following:

We connect clients.

Download the client module from OCS Inventory NG Agents http://www.ocsinventory-ng.org.

Unpack and install.

Do not forget to register the address of the OCS Inventory server and port 80.







2023 gtavrl.ru.