admin: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édenteProchaine révision | Révision précédenteDernière révisionLes deux révisions suivantes | ||
admin:services:grafana.chapril.org [2021/02/03 00:08] – [Configurer le courriel] cpm | admin:services:grafana.chapril.org [2021/03/06 22:43] – [Installation et configuration de Grafana] qgibeaux | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
======= Service grafana.chapril.org ======= | ======= Service grafana.chapril.org ======= | ||
- | <note warning> | + | Ticket sur agir https:// |
- | Extrait | + | 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 : | ||
< | < | ||
- | Notes d' | + | =(^-^)=root@bastion:/ |
+ | server { | ||
+ | listen 80; | ||
+ | listen [::]:80; | ||
- | git clone https://github.com/Mikesch-mp/icingaweb2-module-grafana /usr/share/icingaweb2/modules/grafana | + | server_name grafana.chapril.org; |
- | apt install influxdb influxdb-client | + | |
+ | access_log / | ||
+ | error_log / | ||
+ | |||
+ | include / | ||
+ | include / | ||
+ | |||
+ | rewrite ^(.*)$ | ||
+ | |||
+ | } | ||
+ | |||
+ | 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 : admin.cluster.chapril.org. | ||
+ | |||
+ | Installation : | ||
+ | < | ||
apt-get install -y apt-transport-https | apt-get install -y apt-transport-https | ||
apt-get install -y software-properties-common wget | apt-get install -y software-properties-common wget | ||
wget -q -O - https:// | wget -q -O - https:// | ||
- | sudo add-apt-repository "deb https:// | + | sudo add-apt-repository "deb https:// |
+ | apt update | ||
+ | apt install grafana | ||
+ | </ | ||
- | (April) root@admin: | + | Configuration : |
+ | < | ||
+ | / | ||
+ | systemctl enable grafana-server.service | ||
+ | systemctl start grafana-server | ||
+ | </ | ||
+ | |||
+ | <note important> | ||
+ | |||
+ | ==== Intégration des données d' | ||
+ | |||
+ | === InfluxDB === | ||
+ | |||
+ | Installation d' | ||
+ | < | ||
+ | apt install influxdb influxdb-client | ||
+ | </ | ||
+ | |||
+ | Configuration de la base InfluxDB : | ||
+ | < | ||
+ | =(^-^)=root@admin: | ||
Connected to http:// | Connected to http:// | ||
InfluxDB shell version: 1.6.4 | InfluxDB shell version: 1.6.4 | ||
Ligne 22: | Ligne 95: | ||
CREATE USER icinga2 WITH PASSWORD ' | CREATE USER icinga2 WITH PASSWORD ' | ||
GRANT ALL ON icinga2 TO icinga2 | GRANT ALL ON icinga2 TO icinga2 | ||
+ | < | ||
+ | Activation des modules icinga pour InfluxDB : | ||
+ | |||
+ | < | ||
icinga2 feature enable perfdata | icinga2 feature enable perfdata | ||
icinga2 feature enable influxdb | icinga2 feature enable influxdb | ||
+ | </ | ||
- | vim / | + | Configuration du module Icingaweb2 d' |
+ | < | ||
library " | library " | ||
Ligne 52: | Ligne 131: | ||
} | } | ||
} | } | ||
+ | </ | ||
- | mkdir / | + | === Intégration des données d' |
- | / | + | Se connecter sur l' |
- | systemctl enable grafana-server.service | + | |
- | systemctl start grafana-server | + | |
- | + | ||
- | *attendre l' | + | |
- | + | ||
- | ajouter la conf nginx sur bastion | + | |
- | + | ||
- | server { | + | |
- | listen 80; | + | |
- | + | ||
- | server_name grafana.april.org; | + | |
- | + | ||
- | access_log / | + | |
- | error_log / | + | |
- | + | ||
- | include / | + | |
- | include / | + | |
- | include / | + | |
- | } | + | |
- | + | ||
- | server { | + | |
- | listen 443; | + | |
- | ssl on; | + | |
- | + | ||
- | server_name grafana.april.org; | + | |
- | + | ||
- | access_log / | + | |
- | error_log / | + | |
- | + | ||
- | include / | + | |
- | include / | + | |
- | + | ||
- | location / { | + | |
- | proxy_pass http:// | + | |
- | } | + | |
- | } | + | |
- | + | ||
- | ajouter le cname grafana dans la conf dns | + | |
- | + | ||
- | se connecter sur l' | + | |
- | se connecter en admin | + | |
- | ajouter un datasource influxdb | + | |
+ | Ajouter un datasource InfluxDB avec les informations suivantes : | ||
+ | < | ||
url: http:// | url: http:// | ||
Acces: Server | Acces: Server | ||
Ligne 105: | Ligne 145: | ||
password : ******* | password : ******* | ||
http method: GET | http method: GET | ||
+ | </ | ||
- | Noter le nom du datasource (InfluxDB par défaut) | + | Noter le nom du datasource (InfluxDB par défaut). |
- | Save & Test | + | Cliquer sur "Save & Test". |
- | Générer un token " | + | Générer un token " |
- | Intégrer le dashboard | + | |
- | https:// | + | |
+ | Intégrer dans grafana le dashboard idoine via son id (voir https:// | ||
+ | |||
+ | === Intégration des graphiques Grafana dans Icingaweb2 === | ||
+ | |||
+ | Récupération du module Grafana pour Icingaweb2 : | ||
+ | |||
+ | < | ||
+ | git clone https:// | ||
+ | mkdir / | ||
chown www-data: | chown www-data: | ||
- | vim / | + | </ |
+ | |||
+ | Configuration du module Grafana d' | ||
+ | < | ||
[grafana] | [grafana] | ||
version = " | version = " | ||
Ligne 138: | Ligne 189: | ||
publichost = " | publichost = " | ||
publicprotocol = " | publicprotocol = " | ||
+ | </ | ||
Pour ne pas afficher de graphe vide, il suffit de désactiver les perfdata au niveau du service icinga : | Pour ne pas afficher de graphe vide, il suffit de désactiver les perfdata au niveau du service icinga : | ||
+ | < | ||
enable_perfdata = false | enable_perfdata = false | ||
- | |||
</ | </ | ||
- | ==== Configurer le courriel ==== | + | ==== Configuration du courriel ==== |
La configuration du courriel est importante dans l' | La configuration du courriel est importante dans l' |
admin/services/grafana.chapril.org.txt · Dernière modification : 2021/03/06 22:50 de qgibeaux