Skip to content

Grafana Installation & GLPI 11 Integration

1. Introduction

This documentation provides a complete and production-ready guide for installing Grafana on Ubuntu Server 24.04 and integrating it with GLPI 11. It includes the latest secure APT repository method for Ubuntu 24.04, MariaDB remote-access configuration, and best practices for building GLPI dashboards.

The guide is intended for IT Infrastructure and System Administrators who require:

  • Predictable installation steps

  • Clean APT key management

  • Secure database access

  • Repeatable configurations suitable for enterprise deployment

Each command includes a clear, technical explanation to support auditing and training purposes.


2. System Requirements

2.1 Hardware Requirements

Component Minimum Recommended
CPU 2 vCPU 4 vCPU
RAM 4 GB 8 GB
Storage 20 GB 40+ GB
Network Static IPv4 Static IPv4 + Reverse Proxy

Grafana performance is influenced by dashboard complexity, query load, and refresh intervals.


2.2 Software Requirements

  • Ubuntu Server 24.04 LTS (Noble)

  • GLPI 11.0.2 with MariaDB

  • Grafana OSS Repository (stable)

  • Browser access to port 3000/tcp


2.3 Network Requirements

Component IP Address Ports Description
Grafana Server 192.168.20.9 3000/tcp Grafana UI
GLPI Server 192.168.20.8 80/443, 3306/tcp Web + DB

Requirements:

  • Grafana → GLPI DB on port 3306 must be reachable

  • Firewalls must allow LAN traffic

  • Hostnames or DNS must resolve correctly


3. Process

3.1 Server Preparation


3.1.1 Update System Packages

sudo apt update && sudo apt upgrade -y

Purpose

  • Ensures latest security patches

  • Prevents dependency conflicts before adding new repositories

  • Aligns system packages with Ubuntu 24.04 stable release


3.1.2 Install Essential Utilities

sudo apt install -y wget curl gpg software-properties-common

Purpose

  • wget / curl: required for downloading repository keys

  • gpg: converts ASCII-armored keys into binary format (Ubuntu 24.04 requirement)

  • software-properties-common: provides repository management tools


3.2 Configure Grafana APT Repository (Ubuntu 24.04)

Ubuntu 24.04 requires keyrings to be stored inside /etc/apt/keyrings/ for security. This method prevents the common NO_PUBKEY 963FA27710458545 error.


3.2.1 Remove Old or Invalid Grafana Keys

sudo rm -f /etc/apt/sources.list.d/grafana.list
sudo rm -f /etc/apt/keyrings/grafana.gpg

Purpose

  • Ensures no corrupted or outdated APT repositories remain

  • Prevents APT signature validation errors

  • Guarantees a clean install state


3.2.2 Create Keyring Directory

sudo mkdir -p /etc/apt/keyrings

Purpose

  • Mandatory structure for Ubuntu 24.04’s keyring-based repository validation

  • Keeps key isolation per-application


3.2.3 Import Grafana GPG Key

wget -q -O - https://apt.grafana.com/gpg.key \
  | gpg --dearmor \
  | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null

sudo chmod 644 /etc/apt/keyrings/grafana.gpg

Purpose

  • Downloads the official signing key

  • Converts to .gpg binary format because APT no longer accepts ASCII keys

  • Places key in a secure and readable location


3.2.4 Add Stable Grafana Repository

echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" \
  | sudo tee /etc/apt/sources.list.d/grafana.list

Purpose

  • Registers Grafana as a trusted repository

  • Ensures APT validates packages using the imported key


3.2.5 Update Repository Index

sudo apt update

Purpose

  • Loads metadata from Grafana’s repository

  • Confirms signature validation with no errors


3.3 Install Grafana

sudo apt install -y grafana

Purpose

  • Installs Grafana backend, frontend, plugins, and systemd service units

  • Ensures packages come from the secure Grafana repository


3.4 Enable and Start Grafana

sudo systemctl enable --now grafana-server

Purpose

  • Enables automatic startup during boot

  • Starts Grafana service immediately


3.4.1 Verify Service Status

sudo systemctl status grafana-server

Expected:

  • Service is active (running)

  • Port 3000/tcp is listening


3.5 Access Grafana Web UI

URL:

http://192.168.20.9:3000

Default credentials:

Username Password
admin admin

Grafana will require setting a new password.


3.6 Prepare GLPI Database for Grafana Access

GLPI uses MariaDB in Ubuntu 24.04. Correct config file:

/etc/mysql/mariadb.conf.d/50-server.cnf

3.6.1 Allow Remote Access in MariaDB

Edit config:

sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf

Find:

bind-address = 127.0.0.1

Change to:

bind-address = 0.0.0.0

Purpose

  • Enables MariaDB to accept remote connections

  • Required for Grafana → GLPI DB connectivity

Restart MariaDB:

sudo systemctl restart mariadb

3.6.2 Verify MariaDB Listens on 0.0.0.0

sudo ss -tulpn | grep 3306

Expected:

LISTEN 0.0.0.0:3306


3.6.3 Create Read-Only MySQL User for Grafana

Login:

sudo mysql

Run:

CREATE USER 'grafana'@'192.168.20.9' IDENTIFIED BY 'StrongPassword123!';
GRANT SELECT ON glpi.* TO 'grafana'@'192.168.20.9';
FLUSH PRIVILEGES;

Purpose

  • Protects GLPI database from accidental modification

  • Strict source restriction increases security


3.6.4 Firewall Rule (If UFW Enabled)

sudo ufw allow from 192.168.20.9 to any port 3306

3.6.5 Test Database Connectivity

From Grafana server:

mysql -h 192.168.20.8 -u grafana -p

Should authenticate successfully.


3.7 Add GLPI Database as a Grafana Data Source

In Grafana UI → Connections → MySQL → Add Data Source

Fill in:

Parameter Value
Host 192.168.20.8:3306
Database glpi
User grafana
Password (your password)
TLS Off (LAN)

Click Save & Test

Expected: Database Connection OK


3.8 Example Queries for GLPI Dashboards

3.8.1 Total Tickets by Status

SELECT status, COUNT(*) AS total
FROM glpi_tickets
GROUP BY status;

3.8.2 Tickets by Technician

SELECT CONCAT(u.firstname, ' ', u.realname) AS technician,
       COUNT(t.id) AS total
FROM glpi_tickets t
LEFT JOIN glpi_users u ON u.id = t.users_id_lastupdater
GROUP BY technician
ORDER BY total DESC;

3.8.3 Tickets by Category

SELECT c.name AS category,
       COUNT(t.id) AS total
FROM glpi_tickets t
LEFT JOIN glpi_itilcategories c ON t.itilcategories_id = c.id
GROUP BY category;

4. Post-Installation Actions

4.1 UFW Rules (Optional)

sudo ufw allow 3000/tcp sudo ufw reload

4.2 Backup Grafana Configuration

sudo cp -r /etc/grafana /var/backups/grafana_$(date +%F)

4.3 Retest MySQL Remote Connectivity

mysql -u grafana -h 192.168.20.8 -p

5. Troubleshooting

Error Explanation Resolution
NO_PUBKEY 963FA27710458545 Old Grafana key Re-import key using modern keyring
repository is not signed Wrong key format Ensure .gpg binary key is used
Unable to locate package grafana Repository not loaded Check .list file syntax
Connection refused:3306 DB not listening on 0.0.0.0 Fix 50-server.cnf bind-address
Access denied User misconfigured Recreate GRANT permissions

6. Useful Commands

Grafana Service Control

sudo systemctl start grafana-server sudo systemctl restart grafana-server sudo systemctl stop grafana-server sudo systemctl status grafana-server

Grafana Logs

sudo journalctl -u grafana-server -f

Plugin Management

grafana-cli plugins list-remote grafana-cli plugins install <plugin> grafana-cli plugins update-all

Validate Keyring

gpg --show-keys /etc/apt/keyrings/grafana.gpg

Check Listening Ports

sudo ss -tulpn | grep grafana sudo ss -tulpn | grep 3306