Commit b464a28c by Torkel Ödegaard

devenv: updated devenv provision scripts

parent 645974ec
...@@ -43,6 +43,7 @@ fig.yml ...@@ -43,6 +43,7 @@ fig.yml
docker-compose.yml docker-compose.yml
docker-compose.yaml docker-compose.yaml
/conf/provisioning/**/custom.yaml /conf/provisioning/**/custom.yaml
/conf/provisioning/**/dev.yaml
/conf/ldap_dev.toml /conf/ldap_dev.toml
profile.cov profile.cov
/grafana /grafana
......
apiVersion: 1 apiVersion: 1
providers: providers:
- name: 'dev dashboards' - name: 'gdev dashboards'
folder: 'dev dashboards' folder: 'gdev dashboards'
type: file type: file
options: options:
path: devenv/dashboards/dev-dashboards path: devenv/dev-dashboards
apiVersion: 1 apiVersion: 1
datasources: datasources:
- name: Graphite - name: gdev-graphite
type: graphite type: graphite
access: proxy access: proxy
url: http://localhost:8080 url: http://localhost:8080
jsonData: jsonData:
graphiteVersion: "1.1" graphiteVersion: "1.1"
- name: Prometheus - name: gdev-prometheus
type: prometheus type: prometheus
access: proxy access: proxy
isDefault: true isDefault: true
url: http://localhost:9090 url: http://localhost:9090
- name: InfluxDB - name: gdev-influxdb
type: influxdb type: influxdb
access: proxy access: proxy
database: site database: site
user: grafana user: grafana
password: grafana password: grafana
url: http://localhost:8086 url: http://localhost:8086
jsonData: jsonData:
timeInterval: "15s" timeInterval: "15s"
- name: OpenTsdb - name: gdev-opentsdb
type: opentsdb type: opentsdb
access: proxy access: proxy
url: http://localhost:4242 url: http://localhost:4242
jsonData: jsonData:
tsdbResolution: 1 tsdbResolution: 1
tsdbVersion: 1 tsdbVersion: 1
- name: Elastic - name: gdev-elasticsearch-metrics
type: elasticsearch type: elasticsearch
access: proxy access: proxy
database: "[metrics-]YYYY.MM.DD" database: "[metrics-]YYYY.MM.DD"
...@@ -40,22 +40,22 @@ datasources: ...@@ -40,22 +40,22 @@ datasources:
jsonData: jsonData:
interval: Daily interval: Daily
timeField: "@timestamp" timeField: "@timestamp"
- name: MySQL - name: gdev-mysql
type: mysql type: mysql
url: localhost:3306 url: localhost:3306
database: grafana database: grafana
user: grafana user: grafana
password: password password: password
- name: MSSQL - name: gdev-mssql
type: mssql type: mssql
url: localhost:1433 url: localhost:1433
database: grafana database: grafana
user: grafana user: grafana
password: "Password!" password: "Password!"
- name: Postgres - name: gdev-postgres
type: postgres type: postgres
url: localhost:5432 url: localhost:5432
database: grafana database: grafana
...@@ -64,7 +64,7 @@ datasources: ...@@ -64,7 +64,7 @@ datasources:
jsonData: jsonData:
sslmode: "disable" sslmode: "disable"
- name: Cloudwatch - name: gdev-cloudwatch
type: cloudwatch type: cloudwatch
editable: true editable: true
jsonData: jsonData:
......
...@@ -23,41 +23,36 @@ requiresJsonnet() { ...@@ -23,41 +23,36 @@ requiresJsonnet() {
} }
defaultDashboards() { defaultDashboards() {
requiresJsonnet ln -s -f ../../../devenv/dashboards.yaml ../conf/provisioning/dashboards/dev.yaml
ln -s -f -r ./dashboards/dev-dashboards/dev-dashboards.yaml ../conf/provisioning/dashboards/custom.yaml
} }
defaultDatasources() { defaultDatasources() {
echo "setting up all default datasources using provisioning" 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() { 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 "Usage:"
echo " bulk-dashboards - create and provisioning 400 dashboards" 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() { main() {
local cmd=$1 local cmd=$1
if [[ -z "$cmd" ]]; then
usage
exit 1
fi
if [[ $cmd == "bulk-dashboards" ]]; then if [[ $cmd == "bulk-dashboards" ]]; then
bulkDashboard bulkDashboard
elif [[ $cmd == "default-datasources" ]]; then
defaultDatasources
elif [[ $cmd == "default-dashboards" ]]; then
defaultDashboards
else else
defaultDashboards
defaultDatasources
fi
if [[ -z "$cmd" ]]; then
usage usage
fi fi
} }
main "$@" 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