Started grafana provisioning and corrected template creation by influx start
parent
56512b3086
commit
429ce92207
@ -1,16 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
TOKEN=$(influx auth list --user ${DOCKER_INFLUXDB_INIT_USER_ID} --hide-headers | cut -f 3)
|
||||
ORG=$(influx org list | grep ${DOCKER_INFLUXDB_INIT_ORG_ID} | awk '{print $2}')
|
||||
# creating starting server YAML
|
||||
echo -e "server:\n\tdb-url:${INFLUX_HOST}\n\tdb-org:${ORG}\n\tdb-token:${TOKEN}" >/configs/server.yaml;
|
||||
|
||||
export db_url=$INFLUX_HOST
|
||||
export db_org=$DOCKER_INFLUXDB_INIT_ORG_ID
|
||||
export db_token=$TOKEN
|
||||
|
||||
rm -f temp.yaml
|
||||
( echo "cat <<EOF >final.yaml";
|
||||
cat template.yaml;
|
||||
echo "EOF";
|
||||
) >temp.yaml
|
||||
. temp.yaml
|
||||
cat final.yaml
|
||||
mv final.yaml /server-config/server.yaml
|
||||
# creating grafana yaml
|
||||
influx user create -n grafana -o ${ORG}
|
||||
GRAFANA_USER_ID=$(influx user list --hide-headers --name grafana)
|
||||
GRAFANA_TOKEN=$(influx auth list --user ${GRAFANA_USER_ID} --hide-headers | cut -f 3)
|
||||
echo -e "datasources:\n\t- name: INFLUXDB\n\ttype: influxdb\n\turl:${INFLUX_HOST}\n\tdatabase: test\n\t jsonData:\n\t\thttpMode: GET\n\t\thttpHeaderName1: 'Authorization'\n\tsecureJsonData:\n\t\thttpHeaderValue1: 'Token ${GRAFANA_TOKEN}'"
|
||||
|
Loading…
Reference in New Issue