Skip to content

Commit 4c1dcab

Browse files
committed
grafana script enhancements
1 parent d1e2319 commit 4c1dcab

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

scripts/grafana/start-prometheus.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fi
4141
echo "Starting prometheus network"
4242
${CTR_RUN} network create prometheus-network
4343
echo Starting prometheus
44-
${CTR_RUN} run --name prometheus --network prometheus-network -d -p 9090:9090 -v $PWD/prometheus.yml:/etc/prometheus/prometheus.yml:Z -v $PWD/prometheus_volume:/prometheus:Z quay.io/prometheus/prometheus:latest
44+
${CTR_RUN} run --name prometheus --network=prometheus-network -d -p 9090:9090 -v $PWD/prometheus.yml:/etc/prometheus/prometheus.yml:Z -v $PWD/prometheus_volume:/prometheus:Z quay.io/prometheus/prometheus:latest
4545
echo Starting grafana
4646
${CTR_RUN} run -d --network=prometheus-network --name=grafana -p 3000:3000 -v $PWD/grafana_volume:/var/lib/grafana:Z -v $PWD/provisioning:/etc/grafana/provisioning:Z docker.io/grafana/grafana:latest
4747

scripts/grafana/start.sh

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ then
99
exit 1
1010
fi
1111

12+
13+
mkdir -p grafana_volume/dashboards
14+
mkdir -p influxdb_volume
15+
16+
chmod -R 777 *_volume
17+
18+
mkdir -p provisioning/datasources
19+
cp automatic_influxdb.yml provisioning/datasources/automatic.yml
20+
21+
1222
CTR_RUN=${CTR_RUN:-docker}
1323

1424
# check if argument is file, create the telegraf.conf accordingly
@@ -34,22 +44,10 @@ else
3444
curl -o grafana_volume/dashboards/pcm-dashboard.json $1/dashboard
3545
fi
3646

37-
38-
mkdir -p grafana_volume/dashboards
39-
mkdir -p influxdb_volume
40-
41-
chmod -R 777 *_volume
42-
43-
mkdir -p provisioning/datasources
44-
cp automatic_influxdb.yml provisioning/datasources/automatic.yml
45-
46-
echo Downloading PCM dashboard
47-
curl -o grafana_volume/dashboards/pcm-dashboard.json $1/dashboard
48-
4947
echo "Creating influxdb network"
5048
${CTR_RUN} network create influxdb-network
5149
echo Starting influxdb
52-
${CTR_RUN} run -d --name influxdb -p 8083:8083 -p 8086:8086 -v $PWD/influxdb_volume:/var/lib/influxdb influxdb:1.8.0-alpine --network influxdb-network
50+
${CTR_RUN} run -d --name influxdb -p 8083:8083 -p 8086:8086 --network=influxdb-network -v $PWD/influxdb_volume:/var/lib/influxdb influxdb:1.8.0-alpine
5351
echo Starting telegraf
5452
${CTR_RUN} run -d --name telegraf --network=influxdb-network -v $PWD/telegraf.conf:/etc/telegraf/telegraf.conf:ro telegraf
5553
echo Starting grafana

scripts/grafana/stop.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ for c in grafana telegraf influxdb prometheus; do
1010
fi
1111
done
1212

13+
${CTR_RUN} network rm prometheus-network influxdb-network
14+

0 commit comments

Comments
 (0)