forked from balena-io-experimental/balena-prometheus-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
14 lines (14 loc) · 802 Bytes
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Start prometheus server
service grafana-server start &&
# Add datasource to grafana
curl 'http://admin:admin@127.0.0.1:3000/api/datasources' -X POST -H 'Content-Type: application/json;charset=UTF-8' --data-binary '{"name":"Prometheus","type":"prometheus","url":"http://localhost:80","access":"proxy","isDefault":true}'
# start node discover mechanism
node /etc/prometheus-$PROMETHEUS_VERSION.$DIST_ARCH/discovery/index.js & \
# start prometheus
cd /etc/prometheus-$PROMETHEUS_VERSION.$DIST_ARCH \
&& ./prometheus -web.listen-address ":80" \
-storage.local.path "/data" -storage.local.retention ${STORAGE_LOCAL_RETENTION} \
-alertmanager.url "http://localhost:9093" &
# start alertmanager
cd /etc/alertmanager-$ALERTMANAGER_VERSION.$DIST_ARCH \
&& ./alertmanager -config.file=alertmanager.yml