# 12_Grafana

## grafana

| | |
|---|---|
| **Image** | `grafana/grafana:latest` |
| **Etat** | Up 5 days (healthy) |
| **Compose project** | gemini_grafana (stack ID 63) |
| **Réseau** | gemini_grafana_monitor_net |
| **URL** | https://grafana.juxjux.ovh |
| **Source** | https://github.com/grafana/grafana |

### Ports

| Hote | Container | IP |
|---|---|---|
| 3000 | 3000/tcp | 0.0.0.0 |
| 3000 | 3000/tcp | :: |

### Volumes

| Source (hote) | Destination | Type | Mode |
|---|---|---|---|
| `/opt/monitoring/grafana_data` | `/var/lib/grafana` | bind | rw |

---

## Intégration Claude Code — API directe

| | |
|---|---|
| **Statut MCP** | Pas de MCP — API directe possible |
| **Note technique** | API REST Grafana sur /api. Auth : clé API ou Basic Admin. Pas de MCP configuré — appels directs possibles. |

### Ce que nous pouvons faire ensemble

- Lister les dashboards et leur état
- Interroger des datasources Prometheus via l'API (PromQL)
- Créer ou modifier des annotations sur les graphiques
- Exporter des dashboards en JSON pour sauvegarde/versioning

---

## Compte rendu — 2026-06-11

Vérification via Portainer MCP (endpoint 3) + Prometheus PromQL (localhost:9090).

### Métriques VPS globales

| Métrique | Valeur | |
|---|---|---|
| **RAM** | 8.4 / 11.41 GB | 73.6% |
| **Swap** | 3.99 / 4.0 GB | quasi plein |
| **CPU** | 5.2% | — |

### Stack gemini_grafana — 4 containers, tous running (5 jours)

| Container | Image | Etat | Healthcheck | Port exposé |
|---|---|---|---|---|
| grafana | grafana/grafana:latest | running | healthy | 3000 |
| prometheus | prom/prometheus:latest | running | — | 9090 |
| node-exporter | prom/node-exporter:latest | running | — | 9100 |
| cadvisor | gcr.io/cadvisor/cadvisor:latest | running | healthy | 8080 (interne) |

### Notes

- Stack ID Portainer : 63 — compose sur `/data/compose/63/docker-compose.yml`
- Config Prometheus : `/opt/monitoring/prometheus.yml` | Data : `/opt/monitoring/prometheus_data`
- `--web.enable-lifecycle` actif sur Prometheus (reload API disponible sur `:9090/-/reload`)
- cadvisor port 8080 non exposé publiquement (aucun mapping IP externe)
- **grafana.juxjux.ovh** : DNS non résolu depuis l'extérieur — pas de vhost nginx configuré, accès direct via port 3000
- Ports 3000, 9090, 9100 exposés sur `0.0.0.0` — à vérifier dans ufw