mirror of
https://github.com/Alkatrazz24/Funk-lab.git
synced 2026-07-12 15:34:42 +02:00
feat(monitoring): surveillance réseau active via blackbox_exporter
Sondes actives ICMP/HTTP/DNS qui complètent le monitoring passif
(node_exporter + up{}) : joignabilité hôtes/passerelle, accès internet,
santé DNS *.lab.local + forwarding, latence LAN, services de bout en
bout via Traefik.
- blackbox_exporter (chart 11.13.0, ArgoCD, ns monitoring) — ICMP via
NET_RAW, DNS du pod = dnsmasq (chemin réel lab → Traefik)
- 3 jobs blackbox-icmp/-http/-dns (additionalScrapeConfigs)
- alerts-network.yaml : internet, DNS, passerelle, hôtes, services,
latence, exporter (→ pipeline AlertManager existant)
- Asa : outil network_status + contexte présélectionnable reseau
- doc admin/infra/reseau.md + CLAUDE.md + progress
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rc3dLKfqEPHexvFCCx5ZEF
This commit is contained in:
parent
ebb2eec184
commit
649c6fde8e
11 changed files with 527 additions and 5 deletions
102
k8s/infra/monitoring/alerts/alerts-network.yaml
Normal file
102
k8s/infra/monitoring/alerts/alerts-network.yaml
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: PrometheusRule
|
||||
metadata:
|
||||
name: funk-network-alerts
|
||||
namespace: monitoring
|
||||
labels:
|
||||
release: kube-prometheus-stack
|
||||
spec:
|
||||
groups:
|
||||
- name: funk.network
|
||||
interval: 1m
|
||||
rules:
|
||||
|
||||
# --- Joignabilité internet (NAT storage-01 / lien WAN) ---
|
||||
- alert: InternetDown
|
||||
expr: sum(probe_success{job="blackbox-icmp",scope="internet"}) == 0
|
||||
for: 3m
|
||||
labels:
|
||||
severity: critical
|
||||
annotations:
|
||||
summary: "Plus d'accès internet depuis le cluster"
|
||||
description: "Aucune ancre internet (Cloudflare/Quad9) ne répond au ping depuis 3 min. Lien WAN ou NAT storage-01 probablement en cause."
|
||||
|
||||
# --- DNS : résolution *.lab.local (cœur de dnsmasq) ---
|
||||
- alert: DnsLabResolutionFailed
|
||||
expr: probe_success{job="blackbox-dns",module="dns_lab"} == 0
|
||||
for: 3m
|
||||
labels:
|
||||
severity: critical
|
||||
annotations:
|
||||
summary: "dnsmasq ne résout plus *.lab.local"
|
||||
description: "La sonde DNS sur 192.168.10.1:53 (grafana.lab.local) échoue depuis 3 min. Tout l'accès aux services par nom est cassé."
|
||||
|
||||
# --- DNS : forwarding vers l'upstream ---
|
||||
- alert: DnsForwardingFailed
|
||||
expr: probe_success{job="blackbox-dns",module="dns_external"} == 0
|
||||
for: 5m
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: "Forwarding DNS externe en échec"
|
||||
description: "dnsmasq ne résout plus les noms externes (one.one.one.one) depuis 5 min. Résolution interne possiblement OK — vérifier l'upstream."
|
||||
|
||||
# --- Passerelle (storage-01) injoignable en ICMP ---
|
||||
- alert: GatewayUnreachable
|
||||
expr: probe_success{job="blackbox-icmp",instance="192.168.10.1"} == 0
|
||||
for: 2m
|
||||
labels:
|
||||
severity: critical
|
||||
annotations:
|
||||
summary: "Passerelle 192.168.10.1 (storage-01) injoignable"
|
||||
description: "storage-01 ne répond plus au ping depuis le cluster (2 min). NFS, DNS, NAT, PostgreSQL probablement impactés."
|
||||
|
||||
# --- Hôte du LAN cluster injoignable (hors passerelle) ---
|
||||
- alert: ClusterHostUnreachable
|
||||
expr: probe_success{job="blackbox-icmp",scope="lan",instance!="192.168.10.1"} == 0
|
||||
for: 3m
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: "Hôte {{ $labels.instance }} injoignable (ICMP)"
|
||||
description: "{{ $labels.instance }} ne répond plus au ping depuis 3 min. Machine éteinte, lien réseau ou switch ?"
|
||||
|
||||
# --- Service exposé (Traefik / *.lab.local) en échec ---
|
||||
- alert: ServiceEndpointDown
|
||||
expr: probe_success{job="blackbox-http"} == 0
|
||||
for: 5m
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: "Service {{ $labels.instance }} ne répond pas (HTTP)"
|
||||
description: "La sonde HTTP de bout en bout (DNS lab → Traefik) sur {{ $labels.instance }} échoue depuis 5 min (pas de 2xx). Voir probe_http_status_code pour le code renvoyé."
|
||||
|
||||
# --- Latence LAN anormale ---
|
||||
- alert: HighLanLatency
|
||||
expr: probe_icmp_duration_seconds{job="blackbox-icmp",scope="lan",phase="rtt"} > 0.05
|
||||
for: 10m
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: "Latence LAN élevée vers {{ $labels.instance }}"
|
||||
description: "RTT ICMP = {{ $value | printf \"%.3f\" }}s vers {{ $labels.instance }} depuis 10 min (attendu < 5 ms sur le LAN cluster). Switch ou câble ?"
|
||||
|
||||
# --- Service lent (réponse HTTP) ---
|
||||
- alert: SlowServiceResponse
|
||||
expr: probe_duration_seconds{job="blackbox-http"} > 3
|
||||
for: 10m
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: "Réponse lente de {{ $labels.instance }}"
|
||||
description: "La sonde HTTP met {{ $value | printf \"%.1f\" }}s sur {{ $labels.instance }} depuis 10 min."
|
||||
|
||||
# --- blackbox_exporter lui-même injoignable ---
|
||||
- alert: BlackboxExporterDown
|
||||
expr: up{job="blackbox-http"} == 0
|
||||
for: 5m
|
||||
labels:
|
||||
severity: critical
|
||||
annotations:
|
||||
summary: "blackbox_exporter injoignable"
|
||||
description: "Prometheus ne peut plus scraper blackbox_exporter depuis 5 min : toute la surveillance réseau active est aveugle."
|
||||
Loading…
Add table
Add a link
Reference in a new issue