monitoring-grafana-influxdb.../grafana/add_datasources.sh
2018-06-17 13:05:55 +02:00

32 lines
667 B
Bash
Executable File

#!/bin/bash
#set -e
# ADD INFLUXDB DATASOURCE
curl -s -H "Content-Type: application/json" \
-XPOST http://admin:nimda321@localhost:3000/api/datasources \
-d @- <<EOF
{
"name": "influxdb",
"type": "influxdb",
"access": "proxy",
"url": "http://influxdb:8086",
"database": "telegraf",
"user":"telegraf",
"password":"nimda321",
"basicAuth":false
}
EOF
## ADD PROMETHEUS DATASOURCE
curl -s -H "Content-Type: application/json" \
-XPOST http://admin:nimda321@localhost:3000/api/datasources \
-d @- <<EOF
{
"name": "prometheus",
"type": "prometheus",
"access": "proxy",
"url": "http://prometheus:9090"
}
EOF