7) Observabilité & Monitoring
SNMP/Telemetry (gNMI, OpenConfig), NetFlow/sFlow/IPFIX, NMS (Nagios, Zabbix), métriques (Prometheus), visualisation (Grafana), logs & traces (ELK, Loki/Tempo, OpenTelemetry), capture (Wireshark, tcpdump, tcptrack), synthetics & SLO (burn rate), cartographie & capacité.
SNMP Flows PromQL Grafana Logs/Traces Wireshark
SNMP v2c/v3 — Polling, Traps, MIBs & Sécurité
| Aspect | v2c | v3 |
|---|---|---|
| Auth | Community | Users, auth (SHA-256), priv (AES-128) |
| Intégrité | Faible | MAC (HMAC) |
| Confidentialité | Aucune | Chiffrement |
| Contrôle d’accès | ACL IP | VACM (vues) + ACL |
SNMP Stack:
Manager (NMS) ←→ Agent (snmpd) ←→ MIBs/OIDs
Polling: GET/GETNEXT/BULK | Push: TRAP/INFORM
- Mix « polling (historique) + traps (réactivité) ».
- Limiter l’intervalle de scrapes (60s core, 120–300s edge) selon CPU.
! Cisco IOS-XE — SNMPv3 (extrait)
snmp-server group NETOPS v3 priv read CORE write CORE
snmp-server user ops NETOPS v3 auth sha MonSecret priv aes 128 MonSecret2
snmp-server view CORE iso included
snmp-server host 10.0.0.10 version 3 priv ops
! ACL source (mngt only)
snmp-server community public RO 99
access-list 99 permit 10.0.0.0 0.0.0.255
Interfaces (IF-MIB)
- ifHCInOctets / ifHCOutOctets → rate x8 = bit/s
- ifInErrors / ifOutErrors, ifOperStatus, ifAlias
- ifSpeed, ifHighSpeed
Matériel
- ENTITY-SENSOR-MIB → Températures, PSU, Fans
- HOST-RESOURCES-MIB → CPU, Mémoire
Traps utiles
- linkUp / linkDown, coldStart / warmStart
- authenticationFailure, bgpBackwardTransition
# net-snmp (Linux) — /etc/snmp/snmpd.conf
agentAddress udp:161
createUser ops SHA "MonSecret" AES "MonSecret2"
rouser ops authPriv
view all included .1
# Prometheus — snmp_exporter (profil minimal)
modules:
if_mib:
walk: [ sysUpTime, ifName, ifHCInOctets, ifHCOutOctets, ifOperStatus ]
version: 2
NetFlow v5/v9, sFlow, IPFIX — Collecte, Analyse & Détection
| Technologie | Granularité | Charge | Atouts | Limites |
|---|---|---|---|---|
| NetFlow v5 | Flows IPv4 | Faible | Simplicité | Pas IPv6, champs limités |
| NetFlow v9/IPFIX | Templates étendus | Moyenne | Souple, IPv6 | Templates à gérer |
| sFlow | Échantillons paquets | Très faible | Scalable cœur réseau | Perte de détail paquet |
! Cisco IOS — NetFlow v9
ip flow-export destination 10.0.0.20 2055
ip flow-export version 9
interface TenGig1/0/1
ip flow ingress
ip flow egress
# Arista — sFlow (extrait)
sflow enable
sflow agent-ip 10.0.0.11
sflow destination 10.0.0.20 6343
sflow sample 1 out of 1000
sflow polling-interval 30
# nfdump (NetFlow/IPFIX)
nfcapd -D -l /var/log/flows -p 2055
nfdump -r /var/log/flows/nfcapd.* -s ip/bytes -n 20
nfdump -r ... 'port 443 and dst net 10.10.0.0/16'
# pmacct -> Influx/TSDB
plugins: nfprobe, print
aggregate: src_host, dst_host, src_port, dst_port, proto, tos
influxdb_db: flows
- Top talkers/ports, latéralité (east-west), détection DDoS (volumétrie & SYN flood).
- Cartographie applicative (5-tuples) : dépendances & chemins réseau.
Prometheus — Exporters, PromQL, Remote Write & Alerting
Exporters réseau
snmp_exporter(équipements),blackbox_exporter(HTTP/TCP/ICMP/DNS).- HAProxy/Nginx exporters, node_exporter (NIC, IRQ).
Scrape & jitter
- scrape_interval 10–30s critique; 30–60s standard.
- Stagger des scrapes pour lisser la charge.
Cardinalité
- Limiter labels haute cardinalité (IP/UID bruts).
- Regrouper par interface/instance; garder top-N via recording rules.
# Débit NIC (bits/s)
rate(node_network_receive_bytes_total{device!="lo"}[5m]) * 8
# Pertes p95 HTTP
histogram_quantile(0.95, sum by (le) (rate(http_request_duration_seconds_bucket[5m])))
# Erreurs interface (top 10)
topk(10, rate(node_network_receive_errs_total[5m]) + rate(node_network_transmit_errs_total[5m]))
# Taux de succès blackbox
avg_over_time(probe_success[10m]) * 100
# prometheus.yml — remote_write (ex: Thanos/Victoria)
remote_write:
- url: http://thanos-receive:19291/api/v1/receive
send_exemplars: true
# Federation : agréger métriques globales + garder locaux pour détail
# alert_rules.yml — burn rate (multi-window)
groups:
- name: slo
rules:
- alert: ErrorBudgetBurnFast
expr: (rate(http_requests_errors_total[5m]) / rate(http_requests_total[5m])) > (14.4 * 0.001)
for: 10m
labels: {severity: "critical"}
annotations: {summary: "Burn rate élevé (5m) pour SLO 99.9%"}
Grafana — Tableaux, Variables, Transformations & Alerting Unifié
- Dashboards « NOC » synthétiques + dossiers par domaine (réseau, OS, apps).
- Unités correctes (bit/s vs B/s), p95/p99 pour latences.
- Annotations (déploiements/incidents) pour corrélation.
Variables
$env,$instance,$interface(multi-select).- Liens vers logs : « Explore → Loki » avec labels sélectionnés.
Transformations
- Merge, group by, outer join (ex: débit + erreurs interface).
- Thresholds & value mappings (OK/WARN/CRIT).
# Alerting unifié (concept)
- Contact points: Slack, PagerDuty, Email
- Policies: severity routes + Mute Times (maintenance)
- Silences avec tags (env=preprod)
| Panel | Source | But |
|---|---|---|
| Sparkline + p95 | Prometheus | Latences web |
| Geomap | Blackbox/Probes | Disponibilité multi-sites |
| Table erreurs | node_exporter | Top interfaces en faute |
Logs & Traces — ELK/Graylog, Loki/Tempo & OpenTelemetry
# rsyslog -> Logstash -> Elasticsearch (extrait)
*.* @@logstash:5140
input { syslog { port => 5140 } }
filter { grok { match => { "message" => "%{SYSLOGHOST:host} %{GREEDYDATA:msg}" } } }
output { elasticsearch { hosts => ["es:9200"] index => "syslog-%{+YYYY.MM.dd}" } }
# promtail (→ Loki)
server: { http_listen_port: 9080 }
clients: [{ url: http://loki:3100/loki/api/v1/push }]
scrape_configs:
- job_name: syslog
syslog:
listen_address: 0.0.0.0:1514
labels: { job: "syslog" }
# OpenTelemetry Collector (extrait)
receivers: { otlp: { protocols: { http:, grpc: } } }
exporters: { otlp: { endpoint: tempo:4317 }, prometheus: { endpoint: 0.0.0.0:9464 } }
service:
pipelines:
traces: { receivers: [otlp], exporters: [otlp] }
metrics:{ receivers: [otlp], exporters: [prometheus] }
- Indices « chaud/tiède/froid » + ILM (rollover, delete) pour coûts.
- Réduction cardinalité labels; compresser JSON; sampling traces.
Capture & Analyse — tcpdump, tshark, Wireshark, tcptrack, eBPF/xDP
# Filtres BPF utiles
host 10.0.0.5 and port 443
tcp[tcpflags] & (tcp-syn|tcp-ack) == tcp-syn
icmp or icmp6
vlan and ether proto 0x0800 and port 80
net 10.10.0.0/16 and not host 10.10.0.10
# tcpdump ciblé + capture
tcpdump -ni any tcp port 443 -w ssl.pcap
tcpdump -i eth0 -vvv -s 0 -XX "tcp[tcpflags] & tcp-syn != 0 and tcp[tcpflags] & tcp-ack = 0"
# tshark extraire colonnes
tshark -r trace.pcap -Y "http.response" -T fields -e ip.src -e ip.dst -e http.response.code | head
Affichage
tcp.flags.syn==1 && tcp.flags.ack==0(SYN).dns.qry.name contains "example".
Déchiffrage TLS
- SSLKEYLOGFILE côté client; importer dans Wireshark.
- QUIC: encore limité; analyser par flux et clés si dispo.
# tcptrack — flux live (en root)
tcptrack -i eth0
# bpftrace — exemples
bpftrace -e 'kprobe:tcp_v4_connect { @[comm] = count(); }'
bpftrace -e 'tracepoint:net:netif_receive_skb { @[cpu] = count(); }'
Synthetics & RUM — Blackbox, k6, Traceroute, CWV
# blackbox.yml (extrait)
modules:
http_2xx: { prober: http, http: { preferred_ip_protocol: ip4 } }
icmp: { prober: icmp }
// k6 — dispo & latence
import http from "k6/http"; import { sleep } from "k6";
export default function(){ const r=http.get("https://www.example.com/"); if(r.status!==200) throw new Error("KO"); sleep(1); }
<script>
// RUM Core Web Vitals minimal
new PerformanceObserver((list)=>{
for (const e of list.getEntries()) navigator.sendBeacon("/rum", JSON.stringify({name:e.name,value:e.value}));
}).observe({type:"largest-contentful-paint", buffered:true});
</script>
# mtr — traceroute continu
mtr -rwzc 100 www.example.com
SLO, Alerting & Runbooks — RED/USE, Burn Rate & Post-Mortems
| SLI | Métrique | Source | Seuil |
|---|---|---|---|
| Disponibilité HTTP | probe_success% | Blackbox | ≥ 99.9% |
| TTFB | p95 | RUM/Synthetic | ≤ 200ms |
| Perte paquet WAN | %loss | mtr/ICMP | ≤ 0.5% |
# SLO 99.9% → budget d'erreur ≈ 43 min / 30j
# Alerte multi-fenêtres : 5m & 1h (rapide), 6h & 24h (lente)
# Runbook — « Site lent »
1) Vérifier probes (HTTP/ICMP) multi-sites & PoPs CDN
2) TTFB / p95 en hausse ? vérifier origin/LB/WAF
3) Saturation NIC/CPU sur LB/origin (Prometheus)
4) Règles WAF/bot récentes ? (Grafana + logs)
5) Rollback dernier déploiement; post-mortem (5 whys)
NMS — Nagios, Zabbix, LibreNMS : Découverte, Templates & Escalades
| Outil | Forces | Faiblesses |
|---|---|---|
| Nagios | Plugins, simplicité, checks actifs | Moins « moderne » nativement |
| Zabbix | Auto-discovery, templates, cartes | Courbe d’apprentissage |
| LibreNMS | SNMP auto, cartes, alerting | Moins extensible que Zabbix |
# Nagios — check simple
define host{ use linux-server; host_name edge1; address 10.0.0.11 }
define service{ use generic-service; host_name edge1; service_description PING; check_command check_ping!100.0,20%!500.0,60% }
# Zabbix — auto-discovery réseau (idée)
- Découvrir équipements via SNMPv3 + appliquer templates (interfaces, CPU, Temp)
- Cartes dynamiques + dépendances services
# LibreNMS — découverte
./discovery.php -h all
./poller.php -h all
# Alertes via règles + templates de notification (Slack/Email)
Topologie & CMDB — LLDP, NetBox (SoT), Conformité config
show lldp neighbors detail
# Collecter voisins & générer graphe (Graphviz/Geomap Grafana)
# NetBox — modéliser sites/racks/équipements/liaisons
# API pour alimenter monitoring & discovery (source de vérité)
# Oxidized/RANCID — backup & diff config
oxidized
# Règles de conformité (ban IP publics sur mgmt, bannir telnet, bannir SNMPv2c prod)
Capacité & Prévision — 95e percentile, Tendances & Coûts
| Lien | Débit moyen | p95 | Peak | Tendance 30j | Action |
|---|---|---|---|---|---|
| WAN-Paris | 420 Mb/s | 780 Mb/s | 940 Mb/s | +8% | Plan upgrade 1.5G |
| DC-Core1 | 2.1 Gb/s | 5.2 Gb/s | 7.8 Gb/s | +3% | OK (surveillance) |
# 95e percentile: trier les samples 5min, enlever 5% plus hauts, prendre max restant
# Lissage: moving average 7j; saisonnalité: week-ends vs jours ouvrés
# Coûts: transit, interconnexions, stockage logs/metrics
# Optimisations: sampling flows, ILM indices logs, recording rules (Prometheus)
Sécurité & Détection — Suricata/Zeek, EVE JSON & Corrélations
# Suricata — sortie EVE JSON -> Loki/SIEM
- eve.json: { types: [ alert, http, dns, tls, flow ] }
- Export via Filebeat/Promtail vers SIEM/Loki
# Zeek — logs riches (conn, dns, http, ssl)
# Couplage avec Grafana/Loki pour requêtes rapides
# Corréler: Flow volumétrique + alert IDS + logs firewall
# Détection lateral movement: spikes SMB/RDP, authent échecs, DNS anormal
Telemetry moderne — gNMI/OpenConfig, Streaming, eBPF/xDP
# Modèles OpenConfig (YANG) — interfaces, BGP, QoS
# gNMI: subscriptions streaming, TLS/mTLS, dial-in/out
# Pipeline type
[Network Device] --gNMI--> [Collector] --Kafka--> [Processors] --> [TSDB/OLAP/SIEM]
# eBPF — compteurs précis & hooks kernel
bpftool prog show
bpftrace -e 'kprobe:ip_rcv { @[pid] = count(); }'
# xDP — drop/redirect très basse latence (driver)
