GLPI to Grafana exporter
This script exports GLPI statistics from database into JSON format, usable with grafana-infinity-datasource plugin of Grafana. Tested on GLPI version 10.0.6.
Install
pipx install glpi-grafana-exporter[mysql]
(or postgresql)
Example config (config.env):
DBURL=mysql:///support
TICKETS_TABLE=glpi_tickets
USERS_TABLE=glpi_users
JSONFILE=/var/www/html/statistics/glpi.json
OPEN=25
DBURL is in SQLAlchemy format: dialect+driver://username:password@host:port/database, e.g.:
postgresql+psycopg2://user:password@localhost:5432/mydatabase
mysql://user:password@localhost:3306/mydatabase
(you can omit +driver part)
Make JSON file
# make glpi.json with statistics for last year
glpi-grafana-exporter -c config.env --hard 365
# recalculate statistics for a last 3 days (for [daily] cron job)
glpi-grafana-exporter -c config.env --hard 3
at this step you get glpi.json file for Grafana with Infinity Datasource plugin. Update it from cron job.
Make grafana dashboard
- Install Grafana Infinity Datasource plugin
- Configure it (Connection > Data Sources > yesoreyeram-infinity-datasource > Security), to allow "https://raw.githubusercontent.com/" (for demo JSON) or your URL. Save & test.
- use demo/dashboard.json to create dashboard in Grafana (or Grafana Cloud)
Metadata
Release files for glpi_grafana_exporter 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| glpi_grafana_exporter-0.0.1.tar.gz | 164.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| glpi_grafana_exporter-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 171.6 kB
Release files / glpi_grafana_exporter-0.0.1.tar.gz
| Download URL | glpi_grafana_exporter-0.0.1.tar.gz |
|---|---|
| Size | 164.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bbede9583ca486a60784ba2128e6343ccbb851eb0d958f22448db3c22825f305
|
|
BLAKE2b-256 checksum How to use checksums |
bb794abf75dedbbf8d22bf5248a0a3e94e9178becbfab4c6ff87e457a464e617
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.27.0
|
Release files / glpi_grafana_exporter-0.0.1-py3-none-any.whl
| Download URL | glpi_grafana_exporter-0.0.1-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ad2e90aef8b5e287dc77840e2d7fc31651f153fdfb6e05c6c07dbc0f4bdedaa5
|
|
BLAKE2b-256 checksum How to use checksums |
197e3ca9c715b69026fd07a71871c730f88bb5444257db3c83983ee6d126594b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.27.0
|