Demande #4439
Demande #4009: Migrer la supervision vers Icinga2
Déployer un grafana ou équivalent
Start date:
04/25/2020
Due date:
% Done:
90%
Estimated time:
Difficulté:
2 Facile
Description
Les graphes de charge (cup, ram, volumes) renseignent sur les prévisions à faire en termes d'évolutions, et aide à définir si une situation est habituelle (i.e. juste une croissante douce qui passe un seuil) ou inhabituelle (i.e. conséquence d'une potentielle anomalie ou d'un usage inhabituel du service).
Icinga1 s'appuie sur PNP.
Coté Chapril on a adopté grafana.
History
Updated by Quentin Gibeaux 9 months ago
- Assignee set to Quentin Gibeaux
- Target version changed from Backlog to Mai 2020
Updated by Quentin Gibeaux 9 months ago
- Status changed from Nouveau to En cours de traitement
- % Done changed from 0 to 90
Fait, doc à faire
Notes d'installation :
git clone https://github.com/Mikesch-mp/icingaweb2-module-grafana /usr/share/icingaweb2/modules/grafana apt install influxdb influxdb-client apt-get install -y apt-transport-https apt-get install -y software-properties-common wget wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main" (April) root@admin:~# influx Connected to http://localhost:8086 version 1.6.4 InfluxDB shell version: 1.6.4 > CREATE DATABASE icinga2; CREATE USER icinga2 WITH PASSWORD '********'; GRANT ALL ON icinga2 TO icinga2 icinga2 feature enable perfdata icinga2 feature enable influxdb vim /etc/icinga2/features-enabled/influxdb.conf library "perfdata" object InfluxdbWriter "influxdb" { host = "127.1" port = 8086 database = "icinga2" username = "icinga2" password = "*****************" enable_send_thresholds = true enable_send_metadata = true host_template = { measurement = "$host.check_command$" tags = { hostname = "$host.name$" } } service_template = { measurement = "$service.check_command$" tags = { hostname = "$host.name$" service = "$service.name$" } } } mkdir /etc/icingaweb2/modules/grafana /etc/grafana/grafana.ini : décommenter compte admin/password (mettre un mot de passe) systemctl enable grafana-server.service systemctl start grafana-server *attendre l'initialisation initiale* ajouter la conf nginx sur bastion server { listen 80; server_name grafana.april.org; access_log /var/log/nginx/grafana.april.org/grafana.april.org.access_log; error_log /var/log/nginx/grafana.april.org/grafana.april.org.error_log; include /etc/nginx/custom_50x; include /etc/nginx/deny_.git; include /etc/nginx/force-ssl.conf; } server { listen 443; ssl on; server_name grafana.april.org; access_log /var/log/nginx/grafana.april.org/grafana.april.org.access_log; error_log /var/log/nginx/grafana.april.org/grafana.april.org.error_log; include /etc/nginx/custom_50x; include /etc/nginx/deny_.git; location / { proxy_pass http://172.16.0.2:3000; } } ajouter le cname grafana dans la conf dns se connecter sur l'interface grafana pour ajouter un datasource se connecter en admin ajouter un datasource influxdb url: http://127.0.0.1:8086 Acces: Server Database: icinga2 user: icinga2 password : ******* http method: GET Noter le nom du datasource (InfluxDB par défaut) Save & Test Générer un token "viewer" et garder la valeur pour la conf du module grafana d'icinga2 Intégrer le dashboard https://grafana.com/grafana/dashboards/1572?osource=grafana_getting_started chown www-data:icingaweb2 /etc/icingaweb2/modules/grafana vim /etc/icingaweb2/modules/grafana/config.ini [grafana] version = "1" host = "127.1:3000" protocol = "http" timerangeAll = "1w/w" defaultdashboard = "icinga2-default" defaultdashboarduid = "j9hX7K6Wz" defaultdashboardpanelid = "1" defaultorgid = "1" shadows = "0" theme = "light" datasource = "influxdb" accessmode = "proxy" height = "280" width = "640" enableLink = "yes" debug = "0" authentication = "token" apitoken = "************" usepublic = "yes" publichost = "grafana.april.org" publicprotocol = "https"
Updated by François Poulain 9 months ago
Pour ne pas afficher de graphe vide, il suffit de désactiver les perfdata au niveau du service icinga :
enable_perfdata = false
J'ai commencé à passer en revue les services concernés.
Updated by François Poulain 9 months ago
J'ai commencé à passer en revue les services concernés.
J'ai fini de passer en revue les services concernés.