- Correction simulateur: nettoyage code FIWARE (erreurs syntaxe) - Grafana: dashboard complet 10 panneaux sur grafana.digitribe.fr - InfluxDB: datasource corrigée (bucket smartcity, org digitribe) - Nettoyage: suppression services FIWARE (Orion-LD, Stellio, QuantumLeap) - Pipeline validé: Simulator → 3 MQTT brokers → Telegraf → InfluxDB → Grafana - Dashboard URL: https://grafana.digitribe.fr/d/smartcity-martinique-complete/ Architecture simplifiée: - 3 MQTT brokers (EMQX, Mosquitto, BunkerM) - Telegraf pour agrégation - InfluxDB pour stockage time-series - Grafana pour visualisation (Traefik: grafana.digitribe.fr)
24 lines
574 B
Python
24 lines
574 B
Python
#!/usr/bin/env python3
|
|
import json
|
|
import requests
|
|
|
|
# Read the complete dashboard
|
|
with open('/home/eric/smart-city-digital-twin-martinique/grafana-dashboard-complete.json', 'r') as f:
|
|
dashboard = json.load(f)
|
|
|
|
# Import to Grafana
|
|
url = "https://grafana.digitribe.fr/api/dashboards/db"
|
|
auth = ('admin', 'Digitribe972')
|
|
|
|
payload = {
|
|
"dashboard": dashboard,
|
|
"overwrite": True
|
|
}
|
|
|
|
try:
|
|
resp = requests.post(url, json=payload, auth=auth, verify=False)
|
|
print(f"Status: {resp.status_code}")
|
|
print(resp.json())
|
|
except Exception as e:
|
|
print(f"Error: {e}")
|