Skip to content

Commit

Permalink
grafana script enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
rdementi committed Feb 19, 2024
1 parent d1e2319 commit 4c1dcab
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion scripts/grafana/start-prometheus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fi
echo "Starting prometheus network"
${CTR_RUN} network create prometheus-network
echo Starting prometheus
${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
${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
echo Starting grafana
${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

Expand Down
24 changes: 11 additions & 13 deletions scripts/grafana/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ then
exit 1
fi


mkdir -p grafana_volume/dashboards
mkdir -p influxdb_volume

chmod -R 777 *_volume

mkdir -p provisioning/datasources
cp automatic_influxdb.yml provisioning/datasources/automatic.yml


CTR_RUN=${CTR_RUN:-docker}

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


mkdir -p grafana_volume/dashboards
mkdir -p influxdb_volume

chmod -R 777 *_volume

mkdir -p provisioning/datasources
cp automatic_influxdb.yml provisioning/datasources/automatic.yml

echo Downloading PCM dashboard
curl -o grafana_volume/dashboards/pcm-dashboard.json $1/dashboard

echo "Creating influxdb network"
${CTR_RUN} network create influxdb-network
echo Starting influxdb
${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
${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
echo Starting telegraf
${CTR_RUN} run -d --name telegraf --network=influxdb-network -v $PWD/telegraf.conf:/etc/telegraf/telegraf.conf:ro telegraf
echo Starting grafana
Expand Down
2 changes: 2 additions & 0 deletions scripts/grafana/stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ for c in grafana telegraf influxdb prometheus; do
fi
done

${CTR_RUN} network rm prometheus-network influxdb-network

0 comments on commit 4c1dcab

Please sign in to comment.