Export GLPI statistics into Grafana (Grafana Cloud)
Project description
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file glpi_grafana_exporter-0.0.1.tar.gz.
File metadata
- Download URL: glpi_grafana_exporter-0.0.1.tar.gz
- Upload date:
- Size: 164.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbede9583ca486a60784ba2128e6343ccbb851eb0d958f22448db3c22825f305
|
|
| MD5 |
7c9ddb2359ceb73b4958f7736260fd26
|
|
| BLAKE2b-256 |
bb794abf75dedbbf8d22bf5248a0a3e94e9178becbfab4c6ff87e457a464e617
|
File details
Details for the file glpi_grafana_exporter-0.0.1-py3-none-any.whl.
File metadata
- Download URL: glpi_grafana_exporter-0.0.1-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad2e90aef8b5e287dc77840e2d7fc31651f153fdfb6e05c6c07dbc0f4bdedaa5
|
|
| MD5 |
179a525f73ba850831b8800bed0fb4a2
|
|
| BLAKE2b-256 |
197e3ca9c715b69026fd07a71871c730f88bb5444257db3c83983ee6d126594b
|