-
-
Save mkol5222/299b0b18a3b5de641a0cf19b9238de71 to your computer and use it in GitHub Desktop.
grafana_setup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
./run.sh "${@}" & | |
timeout 10 bash -c "until </dev/tcp/localhost/3000; do sleep 1; done" | |
curl -s -H "Content-Type: application/json" \ | |
-XPOST http://admin:admin@localhost:3000/api/datasources \ | |
-d @- <<EOF | |
{ | |
"name": "influx", | |
"type": "influxdb", | |
"access": "proxy", | |
"url": "http://${INFLUX_HOST}:${INFLUX_PORT}", | |
"database": "my_existing_db" | |
} | |
EOF | |
pkill grafana-server | |
timeout 10 bash -c "while </dev/tcp/localhost/3000; do sleep 1; done" | |
exec ./run.sh "${@}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment