services:grafana.chapril.org
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédente | |||
| services:grafana.chapril.org [2026/04/11 17:40] – supprimée - modification externe (Date inconnue) 127.0.0.1 | services:grafana.chapril.org [2026/04/11 17:40] (Version actuelle) – ↷ Page déplacée de admin:services:grafana.chapril.org à services:grafana.chapril.org pitchum | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | ====== Service grafana.chapril.org ====== | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | Cette page présente l' | ||
| + | |||
| + | ===== Installation ===== | ||
| + | |||
| + | ==== Déploiement du domaine grafana.chapril.org ===== | ||
| + | |||
| + | Suivre la procédure d' | ||
| + | |||
| + | ==== Déploiement du domaine sur la VM Bastion ==== | ||
| + | |||
| + | Sur la VM Bastion, configurer un nouveau site : | ||
| + | <code bash> | ||
| + | cd / | ||
| + | cat grafana.chapril.org | ||
| + | </ | ||
| + | <code nginx> | ||
| + | server { | ||
| + | listen 80; | ||
| + | listen [::]:80; | ||
| + | |||
| + | server_name grafana.chapril.org; | ||
| + | |||
| + | access_log / | ||
| + | error_log / | ||
| + | |||
| + | include / | ||
| + | include / | ||
| + | include / | ||
| + | } | ||
| + | |||
| + | server { | ||
| + | listen 443 ssl; | ||
| + | listen [::]:443 ssl; | ||
| + | |||
| + | server_name grafana.chapril.org; | ||
| + | |||
| + | access_log / | ||
| + | error_log / | ||
| + | |||
| + | ssl_certificate | ||
| + | ssl_certificate_key / | ||
| + | |||
| + | include / | ||
| + | include / | ||
| + | |||
| + | location / { | ||
| + | proxy_pass http:// | ||
| + | } | ||
| + | |||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Installation et configuration de Grafana ==== | ||
| + | |||
| + | Sur la VM hébergeant Icingaweb2 : '' | ||
| + | |||
| + | === Installation === | ||
| + | |||
| + | Pour installer : | ||
| + | <code bash> | ||
| + | apt-get install -y apt-transport-https | ||
| + | apt-get install -y software-properties-common wget | ||
| + | wget -q -O - https:// | ||
| + | sudo add-apt-repository "deb https:// | ||
| + | apt update | ||
| + | apt install grafana | ||
| + | </ | ||
| + | |||
| + | === Configuration === | ||
| + | |||
| + | Dans ''/ | ||
| + | <code bash> | ||
| + | systemctl enable grafana-server.service | ||
| + | systemctl start grafana-server | ||
| + | </ | ||
| + | |||
| + | <note important> | ||
| + | Attendre l' | ||
| + | </ | ||
| + | |||
| + | ==== Intégration des données d' | ||
| + | |||
| + | === InfluxDB === | ||
| + | |||
| + | Installation d' | ||
| + | <code bash> | ||
| + | apt install influxdb influxdb-client | ||
| + | </ | ||
| + | |||
| + | Configuration de la base InfluxDB : | ||
| + | <code bash> | ||
| + | cd ~/ | ||
| + | influx | ||
| + | </ | ||
| + | < | ||
| + | Connected to http:// | ||
| + | InfluxDB shell version: 1.6.4 | ||
| + | </ | ||
| + | <code sql> | ||
| + | CREATE DATABASE icinga2; | ||
| + | |||
| + | CREATE USER icinga2 WITH PASSWORD ' | ||
| + | GRANT ALL ON icinga2 TO icinga2 | ||
| + | </ | ||
| + | |||
| + | Activation des modules icinga pour InfluxDB : | ||
| + | |||
| + | <code bash> | ||
| + | icinga2 feature enable perfdata | ||
| + | |||
| + | icinga2 feature enable influxdb | ||
| + | </ | ||
| + | |||
| + | Configuration du module Icingaweb2 d' | ||
| + | <code nagios> | ||
| + | library " | ||
| + | |||
| + | object InfluxdbWriter " | ||
| + | host = " | ||
| + | port = 8086 | ||
| + | database = " | ||
| + | username = " | ||
| + | password = " | ||
| + | enable_send_thresholds = true | ||
| + | enable_send_metadata = true | ||
| + | host_template = { | ||
| + | measurement = " | ||
| + | tags = { | ||
| + | hostname = " | ||
| + | } | ||
| + | } | ||
| + | service_template = { | ||
| + | measurement = " | ||
| + | tags = { | ||
| + | hostname = " | ||
| + | service = " | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | === Intégration des données d' | ||
| + | |||
| + | Se connecter sur l' | ||
| + | |||
| + | Ajouter un // | ||
| + | < | ||
| + | url: http:// | ||
| + | Acces: Server | ||
| + | Database: icinga2 | ||
| + | user: icinga2 | ||
| + | password : ******* | ||
| + | http method: GET | ||
| + | </ | ||
| + | |||
| + | Noter le nom du // | ||
| + | |||
| + | Cliquer sur //Save & Test//. | ||
| + | |||
| + | Générer un jeton //viewer// et garder la valeur pour la configuration du module '' | ||
| + | |||
| + | Intégrer dans Grafana le // | ||
| + | |||
| + | === Intégration des graphiques Grafana dans Icingaweb2 === | ||
| + | |||
| + | Récupération du module Grafana pour Icingaweb2 : | ||
| + | |||
| + | <code bash> | ||
| + | git clone https:// | ||
| + | mkdir / | ||
| + | chown www-data: | ||
| + | </ | ||
| + | |||
| + | Configuration du module Grafana d' | ||
| + | <code ini> | ||
| + | [grafana] | ||
| + | version = " | ||
| + | host = " | ||
| + | protocol = " | ||
| + | timerangeAll = " | ||
| + | defaultdashboard = " | ||
| + | defaultdashboarduid = " | ||
| + | defaultdashboardpanelid = " | ||
| + | defaultorgid = " | ||
| + | shadows = " | ||
| + | theme = " | ||
| + | datasource = " | ||
| + | accessmode = " | ||
| + | height = " | ||
| + | width = " | ||
| + | enableLink = " | ||
| + | debug = " | ||
| + | authentication = " | ||
| + | apitoken = " | ||
| + | usepublic = " | ||
| + | publichost = " | ||
| + | publicprotocol = " | ||
| + | </ | ||
| + | |||
| + | Pour ne pas afficher de graphe vide, il suffit de désactiver les // | ||
| + | |||
| + | <code ini> | ||
| + | enable_perfdata = false | ||
| + | </ | ||
| + | |||
| + | ==== Configuration du courriel ==== | ||
| + | |||
| + | La configuration du courriel est importante dans l' | ||
| + | |||
| + | Éditer ''/ | ||
| + | <code ini> | ||
| + | #################################### | ||
| + | [smtp] | ||
| + | enabled = true | ||
| + | host = localhost: | ||
| + | ;user = | ||
| + | # If the password contains # or ; you have to wrap it with trippel quotes. Ex """# | ||
| + | ;password = | ||
| + | ;cert_file = | ||
| + | ;key_file = | ||
| + | skip_verify = true | ||
| + | from_address = admins-auto@chapril.org | ||
| + | ;from_name = Grafana | ||
| + | | ||
| + | [emails] | ||
| + | welcome_email_on_sign_up = true | ||
| + | </ | ||
| + | |||
| + | Puis redémarrer le service : | ||
| + | <code bash> | ||
| + | systemctl restart grafana-server.service | ||
| + | </ | ||
