Skip to content

Rules engine and dictionaries

The rules are accessible from the Administration > Rules menu.

Dictionaries are accessible from the Administration > Dictionaries menu.

Rules

Presentation

GLPI has rules engine which allows a number of actions and associations to be performed automatically.

The engine is used for:

  • Management rules

    • assignment of machine to an entity
    • user credentials
    • categories to software
    • routing of tickets in entities
    • automatic actions when tickets are created
  • Data dictionaries

    • manufacturers
    • software
    • printers
    • types of materials,
    • hardware models
    • operating system fields

Behaviour

A rule is made up of different criteria. Depending on the option chosen (OR / AND) one or all of the criteria must be completed to trigger an action list.

Preview mechanism allows you to test the rules being written before going into production.

There are several conditions:

  • simple

    • is
    • is not
    • contains
    • does not contain
    • starts with
    • finished by
    • under (for entities titles, indicate to be this title or one of child titles)
    • not under (for entities titles, indicates not to be this title or one of the child titles)
  • complex

    • regular expression checks
    • regular expression doesn't check
  • Regular expressions (aka as regexp) return one or more results that can then be used by actions using the #x directive (where x is the result number of the regular expression).

The engine behaves differently depending on the types of rules:

  • stop after the first rule checked
  • unfolding all rules
  • rules progress with passage of the result to the following

Dictionaries

Dictionaries allow you to modify the data that is entered or already exists in GLPI.

Dictionaries are based on rules engine and are available for certain inventory data (software, manufacturers, titles). These dictionaries allow you to have rules which will modify manually entered values, added automatically via an inventory tool, or plugins (for example, CSV file injector).

The dictionary works in the following manner:

  • added data goes to the dictionary;
  • the rule engine replay all the rules concerning this type of data, and stops after first check;
  • the modified data is returned by the dictionary and inserted into the database.

Here is an example of particular case to better understand this concept:

Context:

  • I have 150 software in my inventory.
  • During inspection, I notice that 80 software programs contain the terms Microsoft and Office.
  • As they are not formatted in the same way, GLPI does not group them!

Solution:

  • I am creating Software dictionary rule.
  • I choose 2 criteria Name of the software BEHAVIOR Microsoft ET Office.
  • I then apply an action Name of the software AFFECT Microsoft Office.

Conclusion:

  • The 80 detected software are now grouped to one.
  • My statistics are improved.

References

Documentation GLPI "dicitonnaries"


Last update: 21/03/2023