Skip to content

Commit

Permalink
Update start-prometheus.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
pavithranp authored and rdementi committed Dec 23, 2022
1 parent 669aeba commit 9186303
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/grafana/start-prometheus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ chmod -R 777 *_volume
mkdir -p provisioning/datasources
cp automatic_prometheus.yml provisioning/datasources/automatic.yml

echo Downloading PCM dashboard


# check if argument is file, create the prometheus.yml accordingly
if [ -f "$1" ]; then
Expand All @@ -26,11 +26,13 @@ if [ -f "$1" ]; then
while read -r line; do
echo " - targets: ['$line']" >> "prometheus.yml"
done < "$1"
echo Downloading PCM dashboard
curl -o grafana_volume/dashboards/pcm-dashboard.json $(head -1 $1)/dashboard/prometheus

else
echo "creating prometheus.yml for $1 ";
sed "s#PCMSENSORSERVER#$1#g" prometheus.yml.template > prometheus.yml
echo Downloading PCM dashboard
curl -o grafana_volume/dashboards/pcm-dashboard.json $1/dashboard/prometheus
fi

Expand Down

0 comments on commit 9186303

Please sign in to comment.