-
Notifications
You must be signed in to change notification settings - Fork 47
/
setup
33 lines (26 loc) · 1.26 KB
/
setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env sh
DOCKER_VOLUME="/volume1/docker"
PROMETHEUS_ROOT="${DOCKER_VOLUME}/prometheus"
folders=( "configs" "data/alertmanager" "data/grafana" "data/prometheus" )
for i in "${folders[@]}"; do
[ ! -d ${PROMETHEUS_ROOT}/${i} ] && mkdir -p ${PROMETHEUS_ROOT}/${i} \
&& echo "folder created ${PROMETHEUS_ROOT}/${i}"
done
chown -R 65534:65534 ${PROMETHEUS_ROOT}/data/prometheus #nobody userid
chown -R 472:472 ${PROMETHEUS_ROOT}/data/grafana #grafana userid
configs=( "grafana.ini" "prometheus.yml" )
for i in "${configs[@]}"; do
curl -fsSL https://raw.githubusercontent.com/prahaladramji/synology-prometheus/master/configs/${i} -o ${PROMETHEUS_ROOT}/configs/${i}
echo "config created ${PROMETHEUS_ROOT}/configs/${i}"
done
curl -fsSL https://raw.githubusercontent.com/prahaladramji/synology-prometheus/master/docker-compose.yml \
| sed "s/\${PROMETHEUS_ROOT}/${PROMETHEUS_ROOT//\//\\/}/g" > ${PROMETHEUS_ROOT}/docker-compose.yml
echo "docker-compose file created ${PROMETHEUS_ROOT}/docker-compose.yml"
docker-compose -f ${PROMETHEUS_ROOT}/docker-compose.yml up -d
echo "
#############################################
Grafana http://`hostname`:3000
Prometheus http://`hostname`:9090
Alertmanager http://`hostname`:9093
Node-Exporter http://`hostname`:9100/metrics
"