main
parent
08a0fb16c5
commit
29a50484e2
|
@ -9,3 +9,4 @@ providers:
|
|||
editable: true
|
||||
options:
|
||||
path: /etc/grafana/provisioning/dashboards/node-exporter
|
||||
allowUiUpdates: true
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
#!/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
|
||||
|
||||
# Import the dashboard
|
||||
cat > /tmp/dashboard-import.json << 'EOL'
|
||||
{
|
||||
"dashboard": {
|
||||
"id": null,
|
||||
"uid": null,
|
||||
"title": "Node Exporter Full",
|
||||
"tags": ["templated"],
|
||||
"timezone": "browser",
|
||||
"schemaVersion": 16,
|
||||
"refresh": "5s"
|
||||
},
|
||||
"folderId": 0,
|
||||
"overwrite": true
|
||||
}
|
||||
EOL
|
||||
|
||||
# Import the dashboard
|
||||
curl -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-d @/tmp/dashboard-import.json \
|
||||
http://admin:admin@localhost:3000/api/dashboards/import
|
||||
|
||||
echo "Dashboard imported successfully!"
|
|
@ -0,0 +1,18 @@
|
|||
#!/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!"
|
Loading…
Reference in New Issue