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).
1. Go on your GLPI.
Skip all actions in CLI mode
1. Go to the list of actions.
Set the number of actions per scheduled task
This value is to be adapted according to your installation of GLPI, operating system and the configuration of PHP. Start with a value between 5 and 10.
Configuring a scheduled task (cron)
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.
"C:\Program Files (x86)\PHP\v5.5\php.exe" "D:\www\glpi\front\cron.php"
4. Save your file.
It is possible to test your script by running it directly and to check in GLPI the execution of the tasks.
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 the cron does not work, the following article should help you solve the problem: Tâche planifiée qui ne s’exécute pas.