GLPI: automatic actions configuration

Presentation of automatic actions

The automatic actions in GLPI is a brick essential to the proper functioning of it.

They perform back-to-back tasks for software optimization and also inventory actions, helpdesk ….

Some examples :

  • Automatic closing of incidents
  • Send email
  • Collecting emails
  • Discovery Management and Inventory in FusionInventory
  • Log rotation

Automatic actions can be performed in two ways:

  • GLPI : the action is triggered by the user surf
  • CLI : the action is triggered by a scheduled task running on the web server (recommended).

Implementation

Configuring GLPI

1. Go on your GLPI.

2. From the navigation menu go to Configuration 1 > Automatic Actions 2 .
Menu : Actions automatiques

3. The list of automatic tasks is displayed with their execution mode, their status and the last execution date.
Liste des actions automatiques (1)Liste des actions automatiques (2)

4. Click on an action to get the details. On the main tab we find the task planning, the execution mode and the status.
Détail d'une action

5. The Statistics 1 tab provides information on the execution of the task.
Statistique d'une action dans GLPI

6. The Logs 1 tab allows the visualization of the logs of the task.
Tâche logs

Skip all actions in CLI mode

1. Go to the list of actions.

2. Check box 1 to select the entire list and click Actions 2.
Sélectionner toutes les tâche

3. Action choose Edit 1, select Features – Execution Mode 2, choose CLI 3 and click Send 4.
Edition en lot

Set the number of actions per scheduled task

1. From the navigation menu go to Setup 1 > General 2.
Configuration générale

2. Go to the System 1 tab and change the Maximum number of simultaneous automatic actions (CLI execution) 2 and Save.
Option de configuration des tâches

Configuring a scheduled task (cron)

Windows

1. Create a file on your web server in the format xxxx.bat in the directory of your choice.

2. Open the file with the editor of your choice.

3. Enter the code below for your installation.

"chemin_installation_de_php\php.exe" "chemin_installation_de_glpi\front\cron.php"

Example:

"C:\Program Files (x86)\PHP\v5.5\php.exe" "D:\www\glpi\front\cron.php"

4. Save your file.

5. Open Task Scheduler 1.
Ouvrir le planificateur

6. Click Create Task … 1.
Création tâche sous Windows

7. Give a name to task 1, check the Execute box even if the user is not logged in 2 and Execute with the maximum permissions 3. Then go to the Triggers tab 4.
Configuration générale de la tache

8. Click the New … button 1.
Ajouter un déclencheur

9. Select the execution frequency every day 1, check the box Repeat task every: 2, indicate frequency 3 and duration 4. Check that the trigger is activated 5 and finally click on the OK button 6.
Configuration du déclencheur

10. The trigger is added 1, go to the Actions tab 2.
Déclencheur ajouté

11. Click New … 1.
Ajouter une action

12. Click the Browse button … 1.
Aller chercher le .bat

13. Select your script 1 and click Open 2.
Sélectionner le fichier

14. Click OK 1.
Ajouter l'action

15. Check that action 1  has been taken into account and click OK 2 to validate the creation of the task.
Action ajoutée

16. The scheduled task has been added to list 1.
Tâche dans le gestionnaire

On Linux (Ubuntu)

1. Open an SSH session on your WEB server.

2. Enter the following command to edit the scheduled tasks.

sudo crontab -e

3. Create the task by entering the following line to execute the action every minute:

1 * * * * php /chemin_installation_glpi/front/cron.php &>/dev/null

4. Save the changes.

5. Restart the cron service.

sudo service cron restart

6. Check in GLPI the execution of automatic actions.

If you are using webmin, the cron job should be configured as below:
Webmin cron



Related Posts


Fusion Inventory: Configuring Discovery and Inventory Tasks
Presentation Through this tutorial, I am going to try to explain you how works FusionInventory and the tasks of network discovery and inventory SNMP in fusioninventory. If you think of be able to inventory the set of the equipment of your network wit

How to update GLPI
In this tutorial I will explain how to update GLPI. Before updating GLPI, I strongly recommend that you make a full backup (file + database). Once your backup is done, you should also check the following: If you use plugins, that they are compatible

GLPI: basic installation and configuration.
In this article, we will see step by step how to install GLPI (Free Management of IT Park). GLPI is an open source solution that offers businesses a complete solution for managing the information system. Features: Help-desk : Incident and request man

Leave a Comment