Supervision Infrastructure IT : Anticipez les Pannes, Optimisez les Performances
“On ne gère que ce que l’on mesure.” Cette maxime du management s’applique parfaitement à l’infrastructure IT. En 2025, les PME de Saint-Nazaire et Loire-Atlantique ne peuvent plus se permettre de découvrir une panne lorsque les utilisateurs se plaignent ou que le chiffre d’affaires chute. Le monitoring proactif est devenu un impératif stratégique pour garantir disponibilité, performance et sécurité.
Ce guide exhaustif explore les solutions de supervision infrastructure modernes : Prometheus, Grafana, Uptime Kuma, monitoring serveurs/réseau/applications, alertes intelligentes, dashboards temps réel, et ROI mesurable. Découvrez comment transformer votre IT d’une boîte noire anxiogène en système transparent et maîtrisé.
Table des Matières
- Monitoring Infrastructure : Enjeux et Bénéfices
- Types de Supervision IT
- Stack Monitoring Moderne : Prometheus + Grafana
- Uptime Kuma : Monitoring Simple et Élégant
- Monitoring Serveurs (Linux, Windows)
- Monitoring Réseau et Équipements
- Monitoring Applications et Services
- Alertes Proactives et Escalade
- Dashboards et Reporting
- Cas d’Usage et ROI Mesurable
1. Monitoring Infrastructure : Enjeux et Bénéfices
Coût de l’Aveuglement Technique
Sans monitoring = Navigation à l’aveugle :
❌ Pannes découvertes par utilisateurs (stress, perte temps, image dégradée) ❌ Diagnostic post-mortem (4-8h investigation vs détection temps réel) ❌ Downtime prolongé (cause inconnue, tâtonnements) ❌ Dégradations progressives non détectées (lenteurs acceptées devenant norme) ❌ Pas de données factuelles (décisions infrastructure au feeling) ❌ Incidents récurrents (causes racines jamais identifiées)
Exemple réel Saint-Nazaire :
PME e-commerce (10 collaborateurs), serveur web :
- Symptôme : Site lent depuis 2 semaines (clients se plaignent)
- Investigation manuelle : 6h (logs Apache, base données, réseau)
- Cause : Disque 98% plein (logs non rotatés)
- Impact : Taux rebond +35%, conversions -22%, perte CA estimée 8 500€
Avec monitoring : Alerte “Disque >90%” J-10 avant impact → Nettoyage préventif 15min → 0€ perte.
✅ Bénéfices Supervision Proactive
1. Disponibilité Maximale (Uptime)
- Détection précoce : Alertes AVANT panne (disque plein, température élevée, services dégradés)
- MTTR réduit : Mean Time To Repair divisé par 5 (diagnostic immédiat vs investigation)
- Objectif 99,9% : 8,76h downtime/an (vs 40-100h sans monitoring)
2. Performance Optimale
- Baseline établie : Référence “normale” (CPU 20-30% charge standard)
- Dégradations détectées : Écarts progressifs (CPU passant 30% → 60% en 3 mois = signe problème)
- Bottlenecks identifiés : Goulots étranglement (RAM saturée, disque lent, réseau congestionné)
- Capacité planifiée : Anticipation besoins (upgrade AVANT saturation)
3. Sécurité Renforcée
- Activités suspectes : Pics connexions anormaux (scan ports, brute-force)
- Compromission détectée : Processus inconnus, trafic inhabituel
- Conformité : Logs centralisés (RGPD, ISO 27001 exigent traçabilité)
4. Décisions Éclairées
- Budgets justifiés : Graphiques prouvant saturation (upgrade serveur nécessaire)
- SLA vérifiables : Prestataires mesurés (uptime réel vs promis)
- Optimisations ROI : Migrations cloud basées sur métriques réelles (pas intuition)
Évolution : Monitoring Réactif → Proactif → Prédictif
Génération 1 : Réactif (années 2000)
- Panne → Alerte → Intervention
- Downtime incompressible (détection = incident actif)
Génération 2 : Proactif (années 2010)
- Anomalie détectée → Intervention préventive → Panne évitée
- Seuils fixes (disque >90%, CPU >80%)
Génération 3 : Prédictif (2020+)
- Machine Learning analyse tendances → Prédiction panne (disque plein dans 12 jours) → Maintenance planifiée
- Seuils dynamiques (CPU >80% anormal si baseline 20%, mais normal si baseline 70%)
2025 : Transition génération 2 → 3 (IA accessible PME via outils like Netdata Cloud, Datadog).
2. Types de Supervision IT
Monitoring Infrastructure (IaaS)
Serveurs physiques/virtuels :
- Matériel : Température CPU/disques, ventilateurs, alimentation
- Ressources : CPU, RAM, disques (utilisation, I/O)
- Réseau : Interfaces (bande passante, erreurs, latence)
- OS : Uptime, processus, services, utilisateurs connectés
Stockage :
- NAS/SAN : Espace libre, santé disques (SMART), RAID dégradé
- Bases de données : Taille, croissance, connexions, requêtes lentes
Réseau :
- Équipements : Switches, firewall, routeurs (disponibilité, CPU, logs)
- Connectivité : Latence internet, bande passante (in/out), perte paquets
- VPN : Tunnels actifs, utilisateurs connectés, débit
Monitoring Applications (SaaS/PaaS)
Sites web :
- Disponibilité : HTTP status (200, 404, 500), certificat SSL
- Performance : Temps réponse (<500ms), temps chargement complet (<3s)
- Contenu : Vérification mots-clés présents (détection défaçage)
APIs :
- Endpoints : Disponibilité, temps réponse, taux erreurs
- Rate limiting : Quotas (alertes si approchant limites)
Bases de données :
- Connexions : Actives, maximum atteint (pool saturation)
- Requêtes : Lentes (>1s), bloquées (deadlocks)
- Cache : Hit ratio (>90% optimal), évictions
Applications métiers :
- ERP : Temps login, disponibilité modules (ventes, achats, stocks)
- CRM : API disponible, synchronisation mobile
- Email : Queue sortante (bloquée ?), taux spam, délivrabilité
Monitoring Expérience Utilisateur (UX)
Real User Monitoring (RUM) :
- Mesure performance réelle utilisateurs (pas synthétique)
- Core Web Vitals : LCP, FID, CLS (Google ranking)
- Géolocalisation : Performances Tokyo vs Saint-Nazaire
Synthetic Monitoring :
- Robots simulent parcours utilisateurs (tests automatisés)
- Scénarios : Login → Ajout panier → Paiement (e-commerce)
- Disponibilité 24/7 (détection pannes hors heures bureau)
Monitoring Sécurité (SIEM)
SIEM (Security Information & Event Management) :
- Agrégation logs (serveurs, firewall, applications)
- Détection intrusions (signatures MITRE ATT&CK)
- Analyse comportementale (connexions inhabituelles)
- Conformité (RGPD, PCI-DSS, ISO 27001)
Outils :
- Wazuh : Open source puissant (gratuit)
- Splunk : Leader commercial (cher : 2000€/GB/an)
- ELK Stack : Elasticsearch + Logstash + Kibana (complexe)
👉 Wazuh SIEM Cybersécurité : Détection menaces temps réel, conformité RGPD/ISO 27001.
3. Stack Monitoring Moderne : Prometheus + Grafana
⚙️ Architecture Prometheus
Principe : Base de données time-series (métriques horodatées).
Modèle pull :
Prometheus Server (scraper)
↓ (scrape toutes les 15s)
Exporters (agents légers sur cibles)
- Node Exporter (serveurs Linux)
- Windows Exporter (serveurs Windows)
- Blackbox Exporter (sites web, TCP)
- SNMP Exporter (équipements réseau)
- PostgreSQL Exporter (bases données)
Avantages pull vs push :
✅ Contrôle centralisé (Prometheus décide quoi scraper) ✅ Détection cibles down (timeout = métrique absente) ✅ Pas de dépendance agent → serveur (agents passifs)
Stockage :
- TSDB (Time-Series Database) optimisée
- Rétention configurable (15j par défaut, 1-3 mois recommandé)
- Compression efficace (1 métrique/15s/serveur = 2MB/mois)
Prometheus : Configuration
Fichier prometheus.yml :
global:
scrape_interval: 15s # Fréquence collecte
evaluation_interval: 15s # Fréquence évaluation règles
# Alertmanager (notifications)
alerting:
alertmanagers:
- static_configs:
- targets: ['localhost:9093']
# Règles alertes
rule_files:
- "alerts.yml"
# Cibles à monitorer
scrape_configs:
# Serveurs Linux
- job_name: 'linux-servers'
static_configs:
- targets:
- 'server1.entreprise.local:9100'
- 'server2.entreprise.local:9100'
relabel_configs:
- source_labels: [__address__]
target_label: instance
# Serveurs Windows
- job_name: 'windows-servers'
static_configs:
- targets: ['dc1.entreprise.local:9182']
# Sites web (Blackbox)
- job_name: 'websites'
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets:
- https://www.entreprise.com
- https://app.entreprise.com
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- target_label: __address__
replacement: localhost:9115 # Blackbox exporter
Règles alertes (alerts.yml) :
groups:
- name: infrastructure
interval: 30s
rules:
# CPU élevé
- alert: HighCPU
expr: 100 - (avg by(instance) (irate(node_cpu_seconds_total{mode="idle"}[5m])) * 100) > 80
for: 10m
labels:
severity: warning
annotations:
summary: "CPU >80% pendant 10min sur {{ $labels.instance }}"
description: "Valeur actuelle: {{ $value }}%"
# Disque plein
- alert: DiskAlmostFull
expr: (node_filesystem_avail_bytes / node_filesystem_size_bytes) * 100 < 10
for: 5m
labels:
severity: critical
annotations:
summary: "Disque {{ $labels.mountpoint }} <10% libre sur {{ $labels.instance }}"
# RAM élevée
- alert: HighMemory
expr: (1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)) * 100 > 90
for: 10m
labels:
severity: warning
annotations:
summary: "RAM >90% sur {{ $labels.instance }}"
# Service down
- alert: ServiceDown
expr: up{job="linux-servers"} == 0
for: 2m
labels:
severity: critical
annotations:
summary: "Serveur {{ $labels.instance }} inaccessible"
# Site web down
- alert: WebsiteDown
expr: probe_success{job="websites"} == 0
for: 2m
labels:
severity: critical
annotations:
summary: "Site {{ $labels.instance }} inaccessible"
# Certificat SSL expiration
- alert: SSLCertExpiringSoon
expr: probe_ssl_earliest_cert_expiry - time() < 86400 * 30
labels:
severity: warning
annotations:
summary: "Certificat SSL {{ $labels.instance }} expire dans <30j"
Grafana : Visualisation
Principe : Dashboards interactifs (graphiques temps réel).
Connexion Prometheus :
Configuration → Data Sources → Add Prometheus
URL: http://localhost:9090
Dashboards communautaires (Grafana.com) :
- Node Exporter Full (ID 1860) : Serveurs Linux complets
- Windows Exporter (ID 14694) : Serveurs Windows
- Blackbox Exporter (ID 13659) : Sites web, SSL
- PostgreSQL (ID 9628) : Bases données
Personnalisation :
- Variables : Dropdown serveurs (dynamique)
- Panels : Graphiques (ligne, jauge, stat, table)
- Annotations : Événements (déploiements, incidents)
- Alertes Grafana : Notifications Slack/Teams/Email
Exemple dashboard PME :
┌─────────────────────────────────────────┐
│ Infrastructure Overview │
├─────────────────────────────────────────┤
│ Uptime 30j: 99.87% Incidents: 2 │
│ Serveurs: 4/4 UP Sites: 3/3 UP │
├─────────────────────────────────────────┤
│ [Graphique CPU] [Graphique RAM] │
│ [Graphique Disque] [Graphique Réseau] │
├─────────────────────────────────────────┤
│ Alertes Actives (2): │
│ ⚠️ Server2 - Disque >85% │
│ ⚠️ Site web - Temps réponse >800ms │
└─────────────────────────────────────────┘
Alertmanager : Notifications
Configuration (alertmanager.yml) :
global:
resolve_timeout: 5m
# Routes (où envoyer alertes)
route:
receiver: 'default'
group_by: ['alertname', 'instance']
group_wait: 10s
group_interval: 10m
repeat_interval: 4h
routes:
# Critiques → Appel téléphone
- match:
severity: critical
receiver: 'pagerduty'
# Warnings → Email + Slack
- match:
severity: warning
receiver: 'email-slack'
# Récepteurs notifications
receivers:
- name: 'default'
email_configs:
- to: '[email protected]'
from: '[email protected]'
smarthost: 'smtp.entreprise.com:587'
auth_username: '[email protected]'
auth_password: '<password>'
- name: 'email-slack'
email_configs:
- to: '[email protected]'
slack_configs:
- api_url: '<webhook_url>'
channel: '#alertes-it'
title: '{{ .GroupLabels.alertname }}'
text: '{{ range .Alerts }}{{ .Annotations.summary }}\n{{ end }}'
- name: 'pagerduty'
pagerduty_configs:
- service_key: '<pagerduty_key>'
Escalade intelligente :
Alerte critique détectée
→ Email admin (immédiat)
→ (si pas d'accusé 5min) SMS
→ (si pas d'action 10min) Appel téléphone
→ (si pas de réponse 15min) Manager IT
4. Uptime Kuma : Monitoring Simple et Élégant
Présentation Uptime Kuma
Alternative moderne à Uptime Robot, Pingdom (SaaS payants).
Caractéristiques :
- Open source : Gratuit, auto-hébergé
- Interface moderne : Dashboard élégant (temps réel)
- Multi-protocoles : HTTP(S), TCP, Ping, DNS, Docker, bases données
- Status page publique : https://status.entreprise.com (communication clients)
- Notifications : 90+ intégrations (Email, Slack, Telegram, Discord, webhook)
Installation Docker :
docker run -d --restart=always \
-p 3001:3001 \
-v uptime-kuma:/app/data \
--name uptime-kuma \
louislam/uptime-kuma:1
Accès : http://localhost:3001 (configuration initiale admin).
Configuration Monitors
Types monitors :
1. HTTP(s) :
- URL : https://www.entreprise.com
- Interval : 60s
- Codes attendus : 200-299
- Timeout : 10s
- Mots-clés requis : “Bienvenue” (vérification contenu)
2. TCP Port :
- Host : db.entreprise.local
- Port : 5432 (PostgreSQL)
- Interval : 60s
3. Ping (ICMP) :
- Host : 192.168.1.1 (firewall)
- Interval : 30s
4. DNS :
- Hostname : www.entreprise.com
- Resolver : 1.1.1.1 (Cloudflare)
- Expected IP : 198.51.100.10
5. Docker Container :
- Docker Host : unix:///var/run/docker.sock
- Container : nginx
- Status : Running
6. Certificate :
- URL : https://www.entreprise.com
- Alert days : 30 (alerte si expire <30j)
Status Page Publique
Création :
Settings → Status Pages → Create → slug : status
URL publique : https://uptime-kuma.entreprise.com/status/status
Personnalisation :
- Logo : Upload logo entreprise
- Titre : “État Services Entreprise XYZ”
- Description : “Surveillance temps réel disponibilité services”
- Monitors affichés : Site web, API, Portail client
- Incidents : Historique (dates, durées, causes)
Exemple :
┌─────────────────────────────────────┐
│ État Services Entreprise XYZ │
├─────────────────────────────────────┤
│ 🟢 Site Web (99,94% uptime 30j) │
│ 🟢 API REST (99,98% uptime 30j) │
│ 🔴 Portail Client (maintenance) │
├─────────────────────────────────────┤
│ Incidents Récents: │
│ 2025-10-15 10:30-11:15 (45min) │
│ Site Web - Maintenance serveur │
└─────────────────────────────────────┘
Communication proactive : Clients consultent status page (évite tickets support inutiles).
Notifications Multi-Canaux
Configuration :
Settings → Notifications → Add
Canaux populaires :
Email :
- SMTP : smtp.entreprise.com:587
- From : [email protected]
- To : [email protected]
Slack :
- Webhook URL : https://hooks.slack.com/services/…
- Channel : #alertes-infra
Telegram :
- Bot Token : (créé via @BotFather)
- Chat ID : (récupéré via @userinfobot)
Discord :
- Webhook URL : https://discord.com/api/webhooks/…
Webhook personnalisé :
- URL : https://api.entreprise.com/webhook/monitoring
- Body : JSON customisable (intégration interne)
Exemple notification :
🔴 Alerte DOWN
Monitor: Site Web (www.entreprise.com)
Status: DOWN (503 Service Unavailable)
Duration: 2min 34s
Time: 2025-10-20 14:23:15
Message: Backend server timeout
5. Monitoring Serveurs (Linux, Windows)
Serveurs Linux (Node Exporter)
Installation :
# Téléchargement
wget https://github.com/prometheus/node_exporter/releases/download/v1.7.0/node_exporter-1.7.0.linux-amd64.tar.gz
tar xvfz node_exporter-1.7.0.linux-amd64.tar.gz
sudo mv node_exporter-1.7.0.linux-amd64/node_exporter /usr/local/bin/
# Service systemd
sudo tee /etc/systemd/system/node_exporter.service <<EOF
[Unit]
Description=Node Exporter
After=network.target
[Service]
Type=simple
User=node_exporter
ExecStart=/usr/local/bin/node_exporter
[Install]
WantedBy=multi-user.target
EOF
# Démarrage
sudo useradd -rs /bin/false node_exporter
sudo systemctl daemon-reload
sudo systemctl enable node_exporter
sudo systemctl start node_exporter
Métriques exposées (http://localhost:9100/metrics) :
- CPU :
node_cpu_seconds_total{mode="idle|user|system"} - RAM :
node_memory_MemTotal_bytes,node_memory_MemAvailable_bytes - Disque :
node_filesystem_size_bytes,node_filesystem_avail_bytes - Réseau :
node_network_receive_bytes_total,node_network_transmit_bytes_total - Load average :
node_load1,node_load5,node_load15 - Uptime :
node_time_seconds - node_boot_time_seconds
Serveurs Windows (Windows Exporter)
Installation :
- Télécharger windows_exporter
- Exécuter MSI (admin requis)
- Service Windows démarré automatiquement
Port : 9182 (http://localhost:9182/metrics)
Métriques :
- CPU :
windows_cpu_time_total{mode="idle|user|privileged"} - RAM :
windows_os_physical_memory_free_bytes - Disque :
windows_logical_disk_free_bytes{volume="C:"} - Réseau :
windows_net_bytes_received_total,windows_net_bytes_sent_total - Services :
windows_service_state{name="W3SVC",state="running"}
Métriques Avancées
SMART disques (prédiction pannes) :
Node Exporter avec textfile collector :
# Installation smartmontools
apt install smartmontools -y
# Script collecte SMART
#!/bin/bash
TEXTFILE_DIR=/var/lib/node_exporter/textfile_collector
smartctl -A /dev/sda | awk '
/Temperature_Celsius/ {print "disk_temperature_celsius{device=\"sda\"} " $10}
/Reallocated_Sector_Ct/ {print "disk_reallocated_sectors{device=\"sda\"} " $10}
' > $TEXTFILE_DIR/smart.prom
# Cron toutes les 5min
*/5 * * * * /usr/local/bin/collect_smart.sh
Température serveur :
# Installation lm-sensors
apt install lm-sensors -y
sensors-detect --auto
# Node Exporter expose automatiquement
# Métriques: node_hwmon_temp_celsius{chip="coretemp-isa-0000"}
Processus spécifiques :
# Monitoring process_exporter
wget https://github.com/ncabatoff/process-exporter/releases/download/v0.7.10/process-exporter-0.7.10.linux-amd64.tar.gz
# Config: surveiller nginx, postgres, docker
# Métriques: namedprocess_namegroup_cpu_seconds_total{groupname="nginx"}
6. Monitoring Réseau et Équipements
Équipements Réseau (SNMP)
SNMP (Simple Network Management Protocol) : Standard monitoring switches, routeurs, firewall.
Activation SNMP (exemple pfSense) :
Services → SNMP → Enable
Community: public (lecture seule)
Location: Datacenter Saint-Nazaire
Contact: [email protected]
SNMP Exporter Prometheus :
# Installation
wget https://github.com/prometheus/snmp_exporter/releases/download/v0.24.1/snmp_exporter-0.24.1.linux-amd64.tar.gz
# Configuration Prometheus (prometheus.yml)
scrape_configs:
- job_name: 'snmp'
static_configs:
- targets:
- 192.168.1.1 # Firewall pfSense
- 192.168.1.10 # Switch HP
metrics_path: /snmp
params:
module: [if_mib] # MIB interfaces réseau
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- target_label: __address__
replacement: localhost:9116 # SNMP Exporter
Métriques récupérées :
- Interfaces : Bande passante (in/out), erreurs, collisions
- CPU/RAM : Utilisation switch/routeur
- Températures : Surchauffe équipements
- Uptime : Redémarrages inattendus
Dashboard Grafana : Network UPS Tools (ID 12348).
Monitoring Bande Passante Internet
Speedtest automatisé :
# Installation speedtest-cli
pip3 install speedtest-cli
# Script Prometheus textfile
#!/bin/bash
TEXTFILE=/var/lib/node_exporter/textfile_collector/speedtest.prom
speedtest-cli --json > /tmp/speedtest.json
DOWNLOAD=$(jq -r '.download' /tmp/speedtest.json)
UPLOAD=$(jq -r '.upload' /tmp/speedtest.json)
PING=$(jq -r '.ping' /tmp/speedtest.json)
cat <<EOF > $TEXTFILE
# HELP speedtest_download_bps Download speed (bps)
# TYPE speedtest_download_bps gauge
speedtest_download_bps $DOWNLOAD
# HELP speedtest_upload_bps Upload speed (bps)
# TYPE speedtest_upload_bps gauge
speedtest_upload_bps $UPLOAD
# HELP speedtest_ping_ms Latency (ms)
# TYPE speedtest_ping_ms gauge
speedtest_ping_ms $PING
EOF
# Cron toutes les heures (éviter surcharge tests)
0 * * * * /usr/local/bin/speedtest_prometheus.sh
Alertes :
- Download <80% débit souscrit (500 Mbps souscrit → alerte si <400 Mbps)
- Upload <50% débit souscrit
- Latence >100ms (dégradation qualité VoIP/visio)
Monitoring VPN WireGuard
Prometheus WireGuard Exporter :
# Installation
wget https://github.com/MindFlavor/prometheus_wireguard_exporter/releases/download/3.6.6/prometheus_wireguard_exporter_3.6.6_amd64.deb
dpkg -i prometheus_wireguard_exporter_3.6.6_amd64.deb
# Configuration Prometheus
scrape_configs:
- job_name: 'wireguard'
static_configs:
- targets: ['localhost:9586']
Métriques :
- Peers connectés :
wireguard_peers_total - Derniers handshakes :
wireguard_peer_last_handshake_seconds(<180s = actif) - Bande passante :
wireguard_peer_receive_bytes_total,wireguard_peer_transmit_bytes_total
Dashboard Grafana : WireGuard (ID 13922).
👉 VPN WireGuard : Configuration accès distants sécurisés, monitoring inclus.
7. Monitoring Applications et Services
Sites Web (Blackbox Exporter)
Installation :
wget https://github.com/prometheus/blackbox_exporter/releases/download/v0.24.0/blackbox_exporter-0.24.0.linux-amd64.tar.gz
tar xvfz blackbox_exporter-0.24.0.linux-amd64.tar.gz
sudo mv blackbox_exporter-0.24.0.linux-amd64/blackbox_exporter /usr/local/bin/
Configuration (blackbox.yml) :
modules:
http_2xx:
prober: http
timeout: 10s
http:
valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]
valid_status_codes: [200, 201, 204]
method: GET
fail_if_ssl: false
fail_if_not_ssl: true # HTTPS obligatoire
preferred_ip_protocol: "ip4"
http_post_json:
prober: http
http:
method: POST
headers:
Content-Type: application/json
body: '{"test": true}'
tcp_connect:
prober: tcp
timeout: 5s
icmp_ping:
prober: icmp
timeout: 5s
Métriques :
- Disponibilité :
probe_success{job="websites"} == 1(UP) ou== 0(DOWN) - Temps réponse :
probe_http_duration_seconds{phase="resolve|connect|tls|processing|transfer"} - Certificat SSL :
probe_ssl_earliest_cert_expiry(timestamp expiration) - Codes HTTP :
probe_http_status_code(200, 404, 500…)
Dashboard Grafana : Blackbox Exporter (ID 13659).
Bases de Données
PostgreSQL Exporter :
# Installation
wget https://github.com/prometheus-community/postgres_exporter/releases/download/v0.15.0/postgres_exporter-0.15.0.linux-amd64.tar.gz
# Variable environnement connexion
export DATA_SOURCE_NAME="postgresql://exporter:password@localhost:5432/postgres?sslmode=disable"
# Démarrage
./postgres_exporter
Métriques :
- Connexions :
pg_stat_database_numbackends(actives par base) - Transactions :
pg_stat_database_xact_commit,pg_stat_database_xact_rollback - Requêtes lentes :
pg_stat_statements_max_exec_time(>1s = slow query) - Cache hit ratio :
pg_stat_database_blks_hit / (pg_stat_database_blks_hit + pg_stat_database_blks_read)(>90% optimal) - Taille bases :
pg_database_size_bytes
MySQL Exporter : Équivalent pour MySQL/MariaDB.
Dashboard Grafana : PostgreSQL (ID 9628), MySQL (ID 7362).
Applications Docker
cAdvisor (Container Advisor) :
docker run -d \
--name=cadvisor \
--restart=always \
-p 8080:8080 \
-v /:/rootfs:ro \
-v /var/run:/var/run:ro \
-v /sys:/sys:ro \
-v /var/lib/docker/:/var/lib/docker:ro \
gcr.io/cadvisor/cadvisor:latest
Métriques :
- CPU :
container_cpu_usage_seconds_total{name="nginx"} - RAM :
container_memory_usage_bytes{name="nginx"} - Réseau :
container_network_receive_bytes_total,container_network_transmit_bytes_total - Disque I/O :
container_fs_reads_bytes_total,container_fs_writes_bytes_total
Dashboard Grafana : Docker cAdvisor (ID 193).
8. Alertes Proactives et Escalade
Niveaux d’Urgence
| Niveau | Impact | Délai intervention | Notification |
|---|---|---|---|
| Critical | Production down, perte CA | <30min (24/7) | Appel + SMS |
| High | Service dégradé, 30-50% impact | <2h ouvrées | SMS + Email |
| Medium | Problème localisé, workarounds | <8h | |
| Low | Optimisation, prévention | <48h | Email (digest quotidien) |
Alertes Intelligentes (Réduction Faux Positifs)
1. Seuils adaptatifs :
# Mauvais: Alerte immédiate si CPU >80%
- alert: HighCPU
expr: node_cpu_usage > 80
# Bon: Alerte si CPU >80% PENDANT 10min
- alert: HighCPU
expr: node_cpu_usage > 80
for: 10m # Évite pics temporaires (sauvegarde, compilation)
2. Corrélation événements :
# Si serveur down ET réseau down → 1 alerte (cause réseau)
- alert: ServerDown
expr: up{job="servers"} == 0 AND up{job="network"} == 1
annotations:
summary: "Serveur {{ $labels.instance }} down (cause probablement interne)"
3. Fenêtres maintenance :
# Désactiver alertes maintenance planifiée
# Prometheus: inhibit_rules dans Alertmanager
inhibit_rules:
- source_match:
alertname: 'MaintenanceWindow'
target_match_re:
alertname: '.*'
equal: ['instance']
4. Seuils basés baseline :
Au lieu de seuil fixe (CPU >80%), calculer écart vs moyenne :
# Alerte si CPU actuel >150% de la baseline 7 jours
expr: node_cpu_usage > (avg_over_time(node_cpu_usage[7d]) * 1.5)
Exemple : Serveur batch (CPU 70% nuit, 20% jour) → Seuil adapté automatiquement.
Escalade Automatique
Workflow :
Alerte détectée (Critical)
↓
[Immédiat] Email [email protected]
↓ (attente 5min)
[Si pas ACK] SMS +33 6 XX XX XX XX
↓ (attente 5min)
[Si pas action] Appel téléphone (PagerDuty, Twilio)
↓ (attente 10min)
[Si pas réponse] Appel manager IT + astreinte backup
Outils :
- PagerDuty : 10€/user/mois (escalade, rotations astreinte)
- Opsgenie : 9€/user/mois (Atlassian)
- Custom : Webhook → script Python (Twilio API appels)
Accusé réception (ACK) :
- Lien email “Acknowledge” → Stop escalade
- API :
curl -X POST https://alertmanager/api/v1/alerts/.../ack - Dashboard : Bouton “ACK” (Grafana OnCall)
Gestion Incidents (Post-Mortem)
Incident majeur (>2h downtime, >10k€ impact) :
1. Résolution : Priorité absolue (toute l’équipe mobilisée)
2. Post-mortem (J+3) :
- Chronologie : Timeline détaillée (cause, détection, actions, résolution)
- Root cause : Analyse 5 Whys (cause racine, pas symptôme)
- Impact : Downtime, utilisateurs impactés, CA perdu
- Actions préventives :
- Court terme (<1 semaine) : Monitoring ajouté, seuils baissés
- Moyen terme (<1 mois) : Redondance matériel, procédures améliorées
- Long terme (<6 mois) : Refonte architecture, formation équipe
3. Documentation : Wiki interne (éviter récurrence)
4. Communication : Email clients (transparence, excuses, actions menées)
9. Dashboards et Reporting
Dashboards Opérationnels (Temps Réel)
Dashboard NOC (Network Operations Center) :
┌─────────────────────────────────────────────────────────┐
│ Infrastructure Overview - Temps Réel │
├─────────────────────────────────────────────────────────┤
│ Uptime 30j: 99,94% Incidents: 3 MTTR: 1h23min │
│ Serveurs: 5/5 🟢 Sites: 4/4 🟢 VPN: 12 clients │
├─────────────────────────────────────────────────────────┤
│ [Graphique CPU global] [Graphique RAM globale] │
│ [Graphique Bande passante] [Graphique Latence] │
├─────────────────────────────────────────────────────────┤
│ Alertes Actives (2): │
│ ⚠️ SRV-FILE - Disque C: 88% plein (since 2h) │
│ ⚠️ Site Web - Temps réponse 650ms (baseline 200ms) │
├─────────────────────────────────────────────────────────┤
│ Top 5 Consommateurs Réseau: │
│ 1. SRV-BACKUP (85 Mbps) - Réplication en cours │
│ 2. PC-GRAPHISTE (42 Mbps) - Upload vidéos │
└─────────────────────────────────────────────────────────┘
Dashboard Sécurité :
┌─────────────────────────────────────────────────────────┐
│ Security Monitoring - Wazuh SIEM │
├─────────────────────────────────────────────────────────┤
│ Alertes 24h: 127 Critiques: 2 Investigate: 5 │
├─────────────────────────────────────────────────────────┤
│ [Graphique Tentatives SSH échouées] │
│ [Graphique IPs bloquées (fail2ban)] │
│ [Heatmap Alertes par heure/jour] │
├─────────────────────────────────────────────────────────┤
│ Événements Critiques: │
│ 🔴 2025-10-20 14:23 - Brute-force SSH (78.x.x.x, RU) │
│ → IP bannie 24h, 0 compromission │
│ 🔴 2025-10-19 03:15 - Malware détecté (PC-COMPTA) │
│ → Quarantaine réussie, scan complet OK │
└─────────────────────────────────────────────────────────┘
Rapports Mensuels (Dirigeants)
Rapport Exécutif PDF (automatisé Grafana) :
Page 1 : Executive Summary
- Disponibilité globale : 99,87% (objectif 99,5% ✅ dépassé)
- Incidents : 4 (dont 1 critique, 3 mineurs)
- MTTR moyen : 1h45min (objectif <4h ✅)
- Investissements recommandés : Upgrade SRV-DB (saturation prévue 3 mois)
Page 2 : Uptime et Incidents
- Graphique uptime quotidien (30j)
- Détail incidents (dates, durées, causes, actions correctives)
- Comparaison mois précédents (tendance)
Page 3 : Performances
- Temps réponse sites web (moyennes, p95, p99)
- Latence réseau (évolution)
- Saturation ressources (CPU, RAM, disque par serveur)
Page 4 : Sécurité
- Tentatives intrusions bloquées : 1 247 (vs 980 mois dernier)
- Vulnérabilités détectées : 3 (toutes patchées <48h)
- Mises à jour déployées : 42 patchs sécurité
Page 5 : Recommandations
- Court terme : Nettoyage disque SRV-FILE (gratuit)
- Moyen terme : Upgrade RAM SRV-DB 16GB → 32GB (800€, ROI 6 mois)
- Long terme : Migration cloud hybride (étude faisabilité)
Distribution : Email CEO, Directeur financier, Responsable IT (J+5 fin de mois).
Dashboards Publics (Communication Clients)
Status page (Uptime Kuma OU Grafana Public Dashboard) :
https://status.entreprise.com
┌─────────────────────────────────────────────────────────┐
│ État Services - Entreprise XYZ │
├─────────────────────────────────────────────────────────┤
│ 🟢 Site Web Corporate (99,96% - 30j) │
│ Temps réponse moyen: 245ms │
│ │
│ 🟢 Portail Client (99,87% - 30j) │
│ Temps réponse moyen: 380ms │
│ │
│ 🟢 API REST (99,99% - 30j) │
│ Temps réponse moyen: 120ms │
├─────────────────────────────────────────────────────────┤
│ Maintenance Planifiée: │
│ 📅 2025-10-25 23:00-01:00 - Migration serveurs │
│ Impact: Portail Client indisponible 2h │
├─────────────────────────────────────────────────────────┤
│ Incidents Récents: │
│ 2025-10-18 14:30-15:15 (45min) - Site Web lent │
│ Cause: Attaque DDoS (mitigée par Cloudflare) │
│ Actions: Renforcement WAF, monitoring amélioré │
└─────────────────────────────────────────────────────────┘
Avantages :
- Transparence (confiance clients)
- Réduction tickets support (clients consultent avant appeler)
- Communication proactive (maintenances annoncées)
10. Cas d’Usage et ROI Mesurable
Cas 1 : E-commerce Évité Blackout (La Baule)
Client : Boutique en ligne mode (CA 800k€/an)
Contexte :
- 1 serveur web (VPS 8GB RAM, 4 vCPU)
- Pics trafic soldes (×5 visites habituelles)
Problème détecté (monitoring) :
- J-15 soldes : Alerte “RAM usage >75% baseline”
- Analyse : Croissance progressive (fuite mémoire app PHP)
- Action : Redémarrage service PHP-FPM → RAM normale
- Root cause : Bug code (boucle infinie certaines requêtes)
- Correctif : Patch déployé J-10
Sans monitoring :
- Crash serveur jour J soldes (RAM saturée)
- Downtime : 4-6h (diagnostic + redémarrage + optimisations urgence)
- Perte CA : 4h × 200 visites/h × 50€ panier moyen × 3% conversion = 12 000€
Avec monitoring :
- Coût : 100€/mois × 12 = 1 200€/an
- Perte évitée : 12 000€
- ROI : 900% (1 incident majeur évité suffit)
Cas 2 : PME Industrie Anticipé Panne Disque (Saint-Nazaire)
Client : Atelier mécanique (20 salariés, serveur ERP)
Monitoring SMART disques :
- Semaine 1 :
Reallocated_Sector_Count= 5 (limite 140) - Semaine 3 :
Reallocated_Sector_Count= 18 (progression rapide) - Alerte : Disque dégradé, panne imminente <2 semaines
Action :
- Commande disque remplacement (48h livraison)
- Planification remplacement samedi (hors production)
- Migration données (clonage)
- Downtime : 0h (travaux week-end)
Sans monitoring :
- Panne brutale lundi matin (disque HS complet)
- Downtime : 8-12h (commande disque urgence, livraison, restauration sauvegarde)
- Perte production : 20 salariés × 8h × 30€/h = 4 800€
- Stress, chaos, clients impactés
Coût monitoring : 150€/mois contrat Bronze
Économie : 4 800€ - 1 800€/an (12 mois contrat) = 3 000€ net + sérénité.
⚡ Cas 3 : Cabinet Comptable Performance Optimisée (Pornichet)
Client : 12 collaborateurs, logiciel comptable cloud
Problème initial :
- Lenteurs logiciel (10-15s chargement dossiers)
- Plaintes quotidiennes
- Perte productivité estimée 30min/jour/personne
Monitoring déployé :
- Identification : Requêtes SQL lentes (PostgreSQL >2s)
- Cause : Index manquants tables (100k+ lignes)
- Solution : Création index (30min intervention)
- Résultat : Temps chargement 10s → 0,8s (-92%)
Gain productivité :
- 12 collab × 30min/jour récupérées × 220j/an = 1 320h/an
- Valorisation : 1 320h × 40€/h = 52 800€/an
Coût monitoring + optimisation : 600€ (setup) + 250€/mois (contrat Silver) = 3 600€/an
ROI : 1 367% (52 800€ / 3 600€)
Bonus : Satisfaction collaborateurs (enquête NPS passée de 6/10 à 9/10).
Cas 4 : Startup SaaS Scaling Anticipé (Nantes, client Loire-Atlantique)
Client : Application SaaS B2B (150 clients, croissance +20%/mois)
Monitoring :
- Graphiques CPU/RAM serveurs (Grafana)
- Observation : Croissance linéaire (RAM +5%/mois)
- Projection : Saturation 16GB RAM dans 4 mois
Action proactive :
- Mois M : Planification upgrade (devis, budget validé)
- Mois M+2 : Migration VPS 16GB → 32GB (fenêtre maintenance)
- Downtime : 15min (migration live)
Sans monitoring :
- Mois M+4 : Crash app (OOM - Out Of Memory)
- Downtime : 6-12h (diagnostic, upgrade urgence, tests)
- Clients impactés : 150 (emails, tickets, réputation)
- Churn estimé : 5 clients perdus × 500€ MRR × 12 mois = 30 000€
Avec monitoring :
- Upgrade planifiée, 0 client impacté
- Coût : 20€/mois (différence VPS) × 12 = 240€/an
- Économie : 30 000€ churn évité
Conclusion : Monitoring, Investissement Indispensable 2025
La supervision infrastructure n’est plus un luxe de grandes entreprises mais une nécessité vitale pour PME modernes. En 2025, naviguer sans monitoring = naviguer les yeux bandés sur autoroute : tôt ou tard, l’accident est inévitable.
Points Clés à Retenir
✅ Proactivité : Détection problèmes AVANT pannes (80-90% incidents évités) ✅ Performance : Optimisations basées données factuelles (pas intuition) ✅ Disponibilité : Uptime 99,9% réaliste (vs 95-98% sans monitoring) ✅ ROI mesurable : 1 incident majeur évité = Coût annuel amorti ✅ Sérénité : Dirigeants focus métier (pas pompier IT) ✅ Décisions éclairées : Investissements infrastructure justifiés (graphiques)
Solutions Recommandées PME
Starter (<10 serveurs/sites) :
- Uptime Kuma : Monitoring basique sites web/services (gratuit, 2h setup)
- Coût : 0€ (auto-hébergé VPS existant)
- Use case : TPE, monitoring essentiel
Business (10-30 serveurs/sites) :
- Prometheus + Grafana : Stack complète (métriques détaillées, alertes)
- Déploiement : 1-2j (configuration initiale)
- Coût : 100-200€/mois (hébergement + maintenance)
- Use case : PME, infrastructure critique
Enterprise (>30 serveurs, multi-sites) :
- Prometheus + Grafana + Wazuh SIEM : Monitoring + Cybersécurité
- Déploiement : 1 semaine (architecture HA, intégrations)
- Coût : 500-1200€/mois (infogérance complète)
- Use case : Entreprises >50 salariés, conformité ISO 27001
Prochaines Étapes
Pour démarrer :
- Audit infrastructure : Inventaire serveurs/sites à monitorer
- Choix solution : Uptime Kuma (simple) OU Prometheus (avancé)
- Déploiement pilote : 2-3 serveurs critiques (tests 2 semaines)
- Déploiement complet : Tous serveurs/sites/applications
- Formation équipe : Dashboards, alertes, réactions incidents
Accompagnement disponible :
- Installation Prometheus + Grafana (clé en main)
- Configuration alertes intelligentes (réduction faux positifs)
- Dashboards personnalisés (métiers, dirigeants, clients)
- Formation administrateurs (gestion quotidienne)
- Infogérance monitoring 24/7 (astreinte, escalade)
Articles Complémentaires
- Support Technique PME : Contrats maintenance, SLA garantis
- Services Web Pro : Hébergement, infogérance serveurs 24/7
- Wazuh SIEM Cybersécurité : Détection menaces temps réel
- VPN WireGuard : Monitoring VPN inclus
Services Liés
- Supervision Monitoring : Prometheus, Grafana, Uptime Kuma, alertes proactives
- Wazuh SIEM : Cybersécurité, détection intrusions, conformité
- Services Web Pro : Hébergement VPS, infogérance 24/7
- Support et Infogérance : Contrats maintenance, monitoring inclus
- Interventions : Dépannages urgents, optimisations performances
Contact Supervision Infrastructure
Ordi Plus - Expert Monitoring Infrastructure Saint-Nazaire 📍 Saint-Nazaire (44600) - Loire-Atlantique 📞 02 40 53 21 00 ✉️ [email protected] 💻 Devis gratuit sous 24h
🕐 Horaires : Lundi-Vendredi 9h-19h ⚡ Démo Grafana offerte : Présentation dashboards (30min visio/sur site) 📊 Audit monitoring gratuit : Analyse infrastructure, recommandations métriques essentielles
Zone couverte : Saint-Nazaire, La Baule, Pornichet, Guérande, Saint-Brévin, toute Loire-Atlantique.
Demande monitoring :
- Contact : Description infrastructure (nb serveurs, sites, contraintes)
- Audit : Inventaire, identification métriques critiques
- Démo : Présentation solution (Uptime Kuma OU Prometheus/Grafana)
- Déploiement : Installation, configuration alertes, formation (J+15)
Dernière mise à jour : 20 octobre 2025 Mots-clés : supervision infrastructure Saint-Nazaire, monitoring serveurs Loire-Atlantique, Prometheus Grafana 44600, alertes proactives PME, Uptime Kuma La Baule, monitoring réseau entreprise Pornichet, dashboards temps réel Guérande