prometheus-cadvisor-nodeExp.../import-node-exporter-dashbo...

19 lines
501 B
Bash
Executable File

#!/bin/bash
# Wait for Grafana to be ready
until curl -s http://admin:admin@localhost:3000/api/health; do
echo "Waiting for Grafana to be ready..."
sleep 5
done
# Download the dashboard JSON
DASHBOARD_JSON=$(curl -s https://grafana.com/api/dashboards/1860/revisions/1/download)
# Import the dashboard
curl -X POST \
-H "Content-Type: application/json" \
-d "$DASHBOARD_JSON" \
http://admin:admin@localhost:3000/api/dashboards/import
echo "Node Exporter dashboard imported successfully!"