Created
August 28, 2017 18:18
-
-
Save avarabyeu/ab213787ff4a24fa50a1fc154c8f213a to your computer and use it in GitHub Desktop.
grafana_setup.sh
This file contains hidden or 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