GLPI - Connect an external GLPI
Applies to: Medulla/GLPI
Medulla version: all
GLPI version: 10.0.x
Environment: On-Premise
Category: Medulla
Prerequisites
Before configuring the integration between Medulla and GLPI, ensure that the following items are available and properly configured.
Download the script here: https://dl.medulla-tech.io/ma/change_itsm_parameters.py
1. GLPI database access
Create a dedicated MySQL/MariaDB user for Medulla with the following permissions:
- Read-only (`READ ONLY`) or read/write as needed
- Access to the entire GLPI database
2. Network connectivity
Allow communication between the Medulla server and the GLPI database server:
- Port `3306` open (or a custom port depending on your configuration)
3. Creating a GLPI API user
Create a GLPI user dedicated to API calls with a name of your choice:
In GLPI under `Administration > Users`
- Type: standard user (username / password)
- Recommended profile:
- `Read-Only` or `Super-Admin`
- Assignment:
- Root entity
- Recursive mode enabled
Then generate a user API token (`user_token`)
4. Creating a GLPI API client
Create an API client named `MMC`.
In GLPI, go to `Configuration > General > API`
Then generate the application token (`app_token`)
5. Import SQL views into your GLPI database
In your GLPI database, you must import the file downloaded here:
https://dl.medulla-tech.io/nc/glpi-100.sql
---
Using the script
Help command
./change_itsm_parameters.py --help
usage: change_itsm_parameters.py [-h] --url URL --db-host DB_HOST [--db-port DB_PORT] --db-name DB_NAME --db-user DB_USER --db-pass DB_PASS --api-url API_URL [--api-user API_USER] [--api-pass API_PASS] [--readonly READONLY] [--crypt-key CRYPT_KEY] [--inv-forward INV_FORWARD] [--inv-forward-url INV_FORWARD_URL] [--inv-plugin INV_PLUGIN] [--inv-agent INV_AGENT] [--inv-agent-disabled INV_AGENT_DISABLED]
Update ITSM parameters
options:
-h, --help display this help message and exit
--url URL ITSM provider URL
--db-host DB_HOST ITSM provider database host
--db-port DB_PORT ITSM provider database port
--db-name DB_NAME ITSM provider database name
--db-user DB_USER ITSM provider database user
--db-pass DB_PASS ITSM provider database password
--api-url API_URL ITSM provider API URL
--api-user API_USER ITSM provider API user
--api-pass API_PASS ITSM provider API password
--readonly READONLY Whether the ITSM provider database is read-only for Medulla (optional)
--crypt-key CRYPT_KEY
Decoded GLPI crypt key file - base64 /etc/glpi/glpicrypt.key (optional)
--inv-forward INV_FORWARD
Whether to forward inventory data to the ITSM provider (optional)
--inv-forward-url INV_FORWARD_URL
URL to forward inventory data to (optional)
--inv-plugin INV_PLUGIN
Inventory plugin to use - glpiinventory or fusioninventory (optional)
--inv-agent INV_AGENT
Inventory agent to use on the client machine - glpiagent or fusioninventory (optional, required if --inv-forward is true)
--inv-agent-disabled INV_AGENT_DISABLED
Whether to include the inventory agent in the Medulla agent (optional)
Usage examples:
./change_itsm_parameters.py \
--url https://glpi.mon-domaine.fr/ \
--db-host 10.10.0.101 \
--db-port 3306 \
--db-name GLPI \
--db-user medulla_glpi \
--db-pass yJxI40UzO8Jn7dd7K5Yaml \
--api-url https://glpi.mon-domaine.fr/apirest.php/ \
--api-user medulla_APIUSER \
--api-pass fLN1Zomh877obPhk \