forked from openedx-unsupported/devstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhealthchecks.sh
executable file
·73 lines (68 loc) · 1.75 KB
/
healthchecks.sh
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
set -x
service=$1
if [[ $service == "registrar" ]] || [[ $service == "all" ]]; then
curl http://localhost:18734/heartbeat # registrar
if [ $? -ne 0 ]; then
docker-compose logs
exit 2
fi
echo
fi
if [[ $service == "lms" ]] || [[ $service == "all" ]]; then
echo "Checking LMS heartbeat:"
curl http://localhost:18000/heartbeat #LMs
if [ $? -ne 0 ]; then
docker-compose logs
exit 2
fi
echo
echo "Checking Studio heartbeat:"
curl http://localhost:18010/heartbeat # Studio
if [ $? -ne 0 ]; then
docker-compose logs
exit 2
fi
echo
fi
if [[ $service == "ecommerce" ]] || [[ $service == "all" ]]; then
echo "Checking ecommerce health:"
curl http://localhost:18130/health/ # Ecommerce
if [ $? -ne 0 ]; then
docker-compose logs
exit 2
fi
echo
fi
if [[ $service == "discovery" ]] || [[ $service == "all" ]]; then
echo "Checking discovery health:"
curl http://localhost:18381/health/ # Discovery
if [ $? -ne 0 ]; then
docker-compose logs
exit 2
fi
echo
fi
if [[ $service == "forum" ]] || [[ $service == "all" ]]; then
echo "Checking forum health:"
curl http://localhost:44567/heartbeat # Forums
if [ $? -ne 0 ]; then
docker-compose logs
exit 2
fi
fi
if [[ $service == "edx_notes_api" ]]; then
echo "Checking edx_notes_api health:"
curl http://localhost:18120/heartbeat # edx_notes_api
if [ $? -ne 0 ]; then
docker-compose logs
exit 2
fi
fi
if [[ $service == "credentials" ]]; then
echo "Checking credentials health:"
curl http://localhost:18150/heartbeat # credentials
if [ $? -ne 0 ]; then
docker-compose logs
exit 2
fi
fi