File tree Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 9
9
exit 1
10
10
fi
11
11
12
+ CTR_RUN=${CTR_RUN:- podman}
13
+
12
14
mkdir -p grafana_volume/dashboards
13
15
mkdir -p prometheus_volume
14
16
36
38
curl -o grafana_volume/dashboards/pcm-dashboard.json $1 /dashboard/prometheus
37
39
fi
38
40
41
+ echo " Starting prometheus network"
42
+ ${CTR_RUN} network create prometheus-network
39
43
echo Starting prometheus
40
- docker run --name prometheus -d -p 9090:9090 -v $PWD /prometheus.yml:/etc/prometheus/prometheus.yml -v $PWD /prometheus_volume:/prometheus prom /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
41
45
echo Starting grafana
42
- docker run -d --link =prometheus --name=grafana -p 3000:3000 -v $PWD /grafana_volume:/var/lib/grafana -v $PWD /provisioning:/etc/grafana/provisioning grafana/grafana
46
+ ${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
43
47
44
48
echo Start browser at http://localhost:3000/ and login with admin user, password admin
45
49
Original file line number Diff line number Diff line change 9
9
exit 1
10
10
fi
11
11
12
+ CTR_RUN=${CTR_RUN:- podman}
12
13
13
14
# check if argument is file, create the telegraf.conf accordingly
14
15
if [ -f " $1 " ]; then
@@ -45,12 +46,14 @@ cp automatic_influxdb.yml provisioning/datasources/automatic.yml
45
46
echo Downloading PCM dashboard
46
47
curl -o grafana_volume/dashboards/pcm-dashboard.json $1 /dashboard
47
48
49
+ echo " Creating influxdb network"
50
+ ${CTR_RUN} network create influxdb-network
48
51
echo Starting influxdb
49
- docker run -d --name influxdb -p 8083:8083 -p 8086:8086 -v $PWD /influxdb_volume:/var/lib/influxdb influxdb:1.8.0-alpine
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
53
echo Starting telegraf
51
- docker run -d --name telegraf --link =influxdb -v $PWD /telegraf.conf:/etc/telegraf/telegraf.conf:ro telegraf
54
+ ${CTR_RUN} run -d --name telegraf --network =influxdb -v $PWD /telegraf.conf:/etc/telegraf/telegraf.conf:ro telegraf
52
55
echo Starting grafana
53
- docker run -d --link =influxdb --name grafana -p 3000:3000 -v $PWD /provisioning:/etc/grafana/provisioning -v $PWD /grafana_volume:/var/lib/grafana grafana/grafana
56
+ ${CTR_RUN} run -d --network =influxdb --name grafana -p 3000:3000 -v $PWD /provisioning:/etc/grafana/provisioning -v $PWD /grafana_volume:/var/lib/grafana grafana/grafana
54
57
55
58
echo Start browser at http://localhost:3000/ and login with admin user, password admin
56
59
Original file line number Diff line number Diff line change 1
1
2
+ CTR_RUN=${CTR_RUN:- podman}
2
3
for c in grafana telegraf influxdb prometheus; do
3
4
4
- id=` docker ps -a -q --filter=" name=$c " --format=" {{.ID}}" `
5
+ id=` ${CTR_RUN} ps -a -q --filter=" name=$c " --format=" {{.ID}}" `
5
6
if [ ! -z " $id " ]
6
7
then
7
8
echo Stopping and deleting $c
8
- docker rm $( docker stop $id )
9
+ ${CTR_RUN} rm $( ${CTR_RUN} stop $id )
9
10
fi
10
11
done
11
12
You can’t perform that action at this time.
0 commit comments