monitoring-grafana-influxdb.../grafana/add_datasources.sh

34 lines
682 B
Bash
Raw Normal View History

#!/bin/bash
#set -e
2022-05-06 22:04:51 +00:00
apk add curl
# ADD INFLUXDB DATASOURCE
curl -s -H "Content-Type: application/json" \
2018-06-17 11:05:55 +00:00
-XPOST http://admin:nimda321@localhost:3000/api/datasources \
-d @- <<EOF
{
"name": "influxdb",
"type": "influxdb",
"access": "proxy",
2022-05-06 22:04:51 +00:00
"url": "http://influxdb2:8086",
"database": "telegraf",
"user":"telegraf",
2018-06-17 11:05:55 +00:00
"password":"nimda321",
"basicAuth":false
}
EOF
## ADD PROMETHEUS DATASOURCE
curl -s -H "Content-Type: application/json" \
2018-06-17 11:05:55 +00:00
-XPOST http://admin:nimda321@localhost:3000/api/datasources \
-d @- <<EOF
{
"name": "prometheus",
"type": "prometheus",
"access": "proxy",
"url": "http://prometheus:9090"
}
EOF