Commit b464a28c by Torkel Ödegaard

devenv: updated devenv provision scripts

parent 645974ec
......@@ -43,6 +43,7 @@ fig.yml
docker-compose.yml
docker-compose.yaml
/conf/provisioning/**/custom.yaml
/conf/provisioning/**/dev.yaml
/conf/ldap_dev.toml
profile.cov
/grafana
......
apiVersion: 1
providers:
- name: 'dev dashboards'
folder: 'dev dashboards'
- name: 'gdev dashboards'
folder: 'gdev dashboards'
type: file
options:
path: devenv/dashboards/dev-dashboards
path: devenv/dev-dashboards
apiVersion: 1
datasources:
- name: Graphite
- name: gdev-graphite
type: graphite
access: proxy
url: http://localhost:8080
jsonData:
graphiteVersion: "1.1"
- name: Prometheus
- name: gdev-prometheus
type: prometheus
access: proxy
isDefault: true
url: http://localhost:9090
- name: InfluxDB
- name: gdev-influxdb
type: influxdb
access: proxy
database: site
user: grafana
password: grafana
url: http://localhost:8086
jsonData:
jsonData:
timeInterval: "15s"
- name: OpenTsdb
- name: gdev-opentsdb
type: opentsdb
access: proxy
url: http://localhost:4242
jsonData:
jsonData:
tsdbResolution: 1
tsdbVersion: 1
- name: Elastic
- name: gdev-elasticsearch-metrics
type: elasticsearch
access: proxy
database: "[metrics-]YYYY.MM.DD"
......@@ -40,22 +40,22 @@ datasources:
jsonData:
interval: Daily
timeField: "@timestamp"
- name: MySQL
- name: gdev-mysql
type: mysql
url: localhost:3306
database: grafana
user: grafana
password: password
- name: MSSQL
- name: gdev-mssql
type: mssql
url: localhost:1433
database: grafana
user: grafana
password: "Password!"
- name: Postgres
- name: gdev-postgres
type: postgres
url: localhost:5432
database: grafana
......@@ -64,7 +64,7 @@ datasources:
jsonData:
sslmode: "disable"
- name: Cloudwatch
- name: gdev-cloudwatch
type: cloudwatch
editable: true
jsonData:
......
......@@ -23,41 +23,36 @@ requiresJsonnet() {
}
defaultDashboards() {
requiresJsonnet
ln -s -f -r ./dashboards/dev-dashboards/dev-dashboards.yaml ../conf/provisioning/dashboards/custom.yaml
ln -s -f ../../../devenv/dashboards.yaml ../conf/provisioning/dashboards/dev.yaml
}
defaultDatasources() {
echo "setting up all default datasources using provisioning"
ln -s -f -r ./datasources/default/default.yaml ../conf/provisioning/datasources/custom.yaml
ln -s -f ../../../devenv/datasources.yaml ../conf/provisioning/datasources/dev.yaml
}
usage() {
echo -e "install.sh\n\tThis script installs my basic setup for a debian laptop\n"
echo -e "install.sh\n\tThis script setups dev provision for datasources and dashboards"
echo "Usage:"
echo " bulk-dashboards - create and provisioning 400 dashboards"
echo " default-datasources - provisiong all core datasources"
echo " no args - provisiong core datasources and dev dashboards"
}
main() {
local cmd=$1
if [[ -z "$cmd" ]]; then
usage
exit 1
fi
if [[ $cmd == "bulk-dashboards" ]]; then
bulkDashboard
elif [[ $cmd == "default-datasources" ]]; then
defaultDatasources
elif [[ $cmd == "default-dashboards" ]]; then
defaultDashboards
else
defaultDashboards
defaultDatasources
fi
if [[ -z "$cmd" ]]; then
usage
fi
}
main "$@"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment