Trace: » Good practices

Good practices

The purpose of this document is to summarize good practices and accumulate feedback from the deployment experiences of OCS and GLPI in business environments.

Before launching:

You can read the content of the GLPI project present on the wiki.

Rushing into a new installation of GLPI is not recommended prior to understanding its use. We advise you to first review and understand the following:

Installation of GLPI


It is strongly recommended to install in production environments:

  • versions RC
  • versions svn

This is valid not only for GLPI but also for the plugins.

For the plugin, it should be made sure that:

  • the plugin is declared stable
  • that it functions with the version GLPI which you install
  • that you have the necessary prerequisites (version of PHP, OS, etc.)

No quality assurance of the code is set up for the plugins. Their implementation can vary depending upon the person who writes them. The names of the mainteners are written in the list of the plugins on the GLPI web site.


OCS Inventory and GLPI support the following platforms:

  • Linux
  • Unix
  • Windows
  • Mac OS X

On Linux, certain distributions provide standard packages for the 2 programs:

  • Fedora/Redhat/CentOS: OCS and GLPI, and some plugins are available in the official repositories
  • Debian: propose OCS and GLPI in the repositories
  • Mandriva
  • FIXME : for other distributions please refer to installation procedures of GLPI on the wiki.

To set up OCS properly


  • the importance of the TAG
  • managing duplicates

Deployment of agents OCS

It is necessary to plan your deployment of the OCS agents well. With this in mind, you should take into account the following data:

  • type of platforms (Windows, Linux, Unix, Mac OS X, etc)
  • the method of deployment (automatic for the workstations, manual on the servers)
  • the presence of a Windows domain controller with Active Directory
  • the number of TAGs which will be used

On Unix and Linux there is no automated procedure for deployment of the agent. However, it is possible to use the packages provided by the distributions (if available, for example for Fedora/Redhat/CentOS.)

On Windows it is possible to use an automated deployment scenario to install the agent. Indeed, the OCS project provides an executable named OcsLogon.exe which offers the following functionality:

  • checks for the installation of the agent
  • installation and initialization of the agent
  • update of the agent

Before setting up GLPI

When to use entities, groups and places?


The idea of the multi-entity is to make it possible for GLPI to segment the management of the parks while allowing an easy consolidation of the data of the various parks. This may be useful for a company whose management is hierarchical or where the people must have a vision of the park at various levels. A user who can be attached to several entities with different rights. These rights are able to be preserved or not preserved on the child entities.


  • a company which manages several customers: one can define an entity by customer
  • an administration which has branches and units: one can leverage entities to mimic these structures by using the entities (wisely, as we shall see later)


This concept makes it possible to make regroupings. Those can be various natures:

  • user's association, to manage groups by competence such as Helpdesk for example
  • services: to gather materials, tickets and users in order to recreate the concept of service


The place makes it possible to organize materials and users geographically. They are defined a such tree structure, in order to more accurately represent what there is in reality.


   20 rue de Paris > Building A > 1st floor > Room 225


The recursivity consists in making visible in the sub-entities in an object. That makes it possible to treat the problems in objects on the total/local object.


  • a total supplier with all the entities will be declared in the highest entity, recursive (sub-entities with yes in the interface)
  • a local supplier: will be declared in the entity to which it belongs (under-entity with not)

When to choose to use entities or groups?

FIXME : to explain what each one of these concepts involves

Definition of the entities and the places

It is best to explain the concept of entity and places. Indeed, these concepts are structured for the installation of the application in a customer context. A good practice is to define with the customer, on paper, the hierarchy to be implemented.

Caution: a great number of entities can slow down the application and can involve a large surplus of rules!

Creating assignment rules of the machines to entities

It is essential to thouroghly define the different criteria when assigning the machines in entities. The use of the plugin mass_ocs_import makes it possible to contribute with checking the refining the rules. Indeed it has a tab which lists the machines that are not imported, with the data display coming from OCS. Thus, one can detect which criteria do not check the rule.

In the case of an environment with many entities, it could be valuable to use the following procedure:

  • to deploy agent OCS on only one machine of the entity
  • verify that the syncronization process functions and that the machine is reported in GLPI
  • to check the data reported in GLPI compares to that in OCS

if the data are correct, you may start the deployment of the agents on other stations

Caution: to improve performance it is necessary to know the operation of the rules engine. In the case of the assignments of machines to entities, it stops with the first rule found. Thus it is advisable to place first in the list the rules that which will be applied most often (i.e. rules of assignment to the largest entities).

Definition of the profiles

Similarly it is preferable to define the Hierarchical entities before beginning the configuration of GLPI, it is preferable to think of the profiles of the people. It is important to study well the default application profiles because they meet generic needs.

Centralized management of authorizations from LDAP

The rules of assignment of the rights and the profiles make it possible to delegate the daily management of enablings to directory LDAP. In general one associates a GLPI profile with the LDAP membership. A rule of assignment allows:

  • to assign a person to an entity
  • a profile with a person
  • to enable/disable a person
  • to assign an entity and a profile to a person

Mapping of groups GLPI with groups LDAP

GLPI makes it possible to make the correspondence between groups created in its database and others which come from the directory.

Migration from another asset management system to GLPI

The installation of OCS and GLPI can be used in the following cases: installation of a management system of park in a clean environment, migration of an asset management system of existing park (free or owner), “automation” of the management of the park where it was managed manually before (for example in an Excel or Calc spread sheet)

In the last 2 cases, it is possible to retrieve data from the existing system, in order not to save a manual re-entry again in GLPI. This process uses the plugin injection for CSV files.

Export of the existing data

  1. Count the data to be recovered
  2. Export with the data in a CSV format:
    • with a spread sheet in Excel or Calc, this operation is easy
    • from an existing tool, use the export capabilities of it, or create scripts in order to accomplish this

It is necessary to export to a CSV file type for data to be imported in GLPI. For example:

  • a file for the machines
  • for the network hardware
  • etc

Importation of the data into GLPI

Preparation prior to the injection into a production base

It may be judicious to create a test platform for qualification in order to make a test of the data to be injected, before “polluting” the database of your production GLPI in the event of error. This platform is composed of:

  • a GLPI with a copy of the base of production
  • the data_injection plugin

Define your models of files in the plugin and test them. At the end of the importation of the data are generated:

  • a report/ratio (in HTML or pdf) on the execution of scripts
  • a file CSV containing only rows that have been injected

Injection of the data in production

  1. Install the data_injection plugin CSV (data_injection) on the GLPI of prod.
  2. Create “models” from those of the base of qualification.
  3. Verify the order into which you will inject data (see examples below)
  4. Verify that the data has indeed been inserted

Example: You utilize an export tool inside a an application containing the financial information of existing machines (date of purchase, warranty period, etc) as well as connections to an active network (name of the asset + port) You export the data using this tool the network hardware which will not displayed by OCS (hubs, switchs). You have the number of ports per hardware. Procedure:

  1. Create a model of injection for your network hardware
  2. Inject your network hardware by indicating in the mappings the number of ports of the material
  3. GLPI will create the associated hardware and ports (if you inject a 16 port switch, then 16 ports will be created automatically in GLPI)
  4. Create a model of injection for computers
  5. Inject your computers by indicating in the mappings the name of the active network and port on which it is connected
  6. GLPI will create the computer and will try to connect it to the port of the specified hardware automatically.

Connection OCS/GLPI

GLPI is interfaces natively with OCS Inventory in order to recover its automatic inventory. GLPI can:

  • incorporate the data of several OCS servers
  • to go up the material data
  • to go up the software (with or without OCS dictionary)
  • reassemble the registry keys of Windows machines

GLPI cannot:

  • modify the configuration of OCS
  • update the OCS dictionary
  • control the deployment of OCS applications

OCS Inventory NG and GLPI are in place, what next?

Now that your system is in place, you can look at:

  • plugins
  • how to manage the complete life cycle of a machine