This repository has been archived by the owner on Sep 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbosun.makefile
48 lines (35 loc) · 1.59 KB
/
bosun.makefile
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
BOSUN_IMAGE = stackexchange/bosun
SCOLLECTOR_SHARED = /mnt/shared/scollector
bosun-start: ## start monitoring (bosun)
${DOCKER_CMD} run -d -p 4242:4242 -p 8070:8070 --name bosun ${BOSUN_IMAGE}
bosun-rm:
docker rm -f bosun
bosun-stop:
docker stop bosun
bosun-restart:
docker restart bosun
bosun-exec:
docker exec -ti bosun bash
bosun-update-conf:
docker cp etc/bosun.conf bosun:/data/bosun.conf
docker restart bosun
scollector-install: ${CLUSTER_HOSTS} ${SRVDIR}
[ -f ${SRVDIR}/scollector-linux ] || ( \
wget https://github.com/bosun-monitor/bosun/releases/download/0.5.0/scollector-linux-386 \
-O ${SRVDIR}/scollector-linux ; \
chmod +x ${SRVDIR}/scollector-linux ; \
)
sudo cp ${SRVDIR}/scollector-linux etc/scollector_supervisord.conf etc/scollector.toml ${SCOLLECTOR_SHARED}
sudo cp -r scollector_metrics ${SCOLLECTOR_SHARED}
sudo sed -i -e "s/#HEAD#/${HEADHOST}/" -e "s|#BASE#|${SCOLLECTOR_SHARED}|" \
${SCOLLECTOR_SHARED}/scollector_supervisord.conf ${SCOLLECTOR_SHARED}/scollector.toml
${PSSH} -h ${CLUSTER_HOSTS} -H ${HEADHOST} -i 'sudo cp ${SCOLLECTOR_SHARED}/scollector_supervisord.conf /etc/supervisor/conf.d; \
sudo supervisorctl reload'
scollector-reload: ${CLUSTER_HOSTS}
${PSSH} -h ${CLUSTER_HOSTS} -H ${HEADHOST} -i "sudo supervisorctl reload"
scollector-start: ${CLUSTER_HOSTS}
${PSSH} -h ${CLUSTER_HOSTS} -H ${HEADHOST} -i "sudo supervisorctl start scollector"
scollector-check: ${CLUSTER_HOSTS}
${PSSH} -h ${CLUSTER_HOSTS} -H ${HEADHOST} -i 'pgrep -f scollector-linux'
scollector-stop:
${PSSH} -h ${CLUSTER_HOSTS} -H ${HEADHOST} -i 'sudo supervisorctl stop scollector'