-
Notifications
You must be signed in to change notification settings - Fork 0
/
appd.sh
115 lines (91 loc) · 1.91 KB
/
appd.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/bash
# The script for managing the controller lifecycle
# Variables configured by the installer
VERSION="$2"
CURRENT_DIR="${pwd}"
APPD_HOME="/home/ubuntu1/appdynamics"
EVENTS_SERVICE_HOME="${APPD_HOME}/$2/events-service"
EUM_HOME="${APPD_HOME}/$2/EUM"
CONTROLLER_HOME="${APPD_HOME}/$2/Controller"
_set_java_home()
{
export JAVA_HOME=/home/ubuntu1/java
return
}
_isESRunning()
{
echo "sleeping for 10 seconds"
sleep 10
ps -ef | grep java|grep com.appdynamics.analytics.processor.AnalyticsService
RESULT=$?
return $RESULT
}
_startController()
{
cd "$CONTROLLER_HOME/bin"
./controller.sh start
return
}
_stopController()
{
cd "$CONTROLLER_HOME/bin"
./controller.sh stop
return
}
_startEventsService()
{
echo "Starting Events Service..."
cd "$EVENTS_SERVICE_HOME"
_set_java_home
if [ "$VERSION" \< "4.2" ]; then
echo "Working on a 4.2- version"
./bin/events-service.sh start -y ./conf/events-service-all.yml -p ./conf/events-service-all.properties &
else
echo "Working on a 4.2+ version"
./bin/events-service.sh start -p ./conf/events-service-api-store.properties &
fi
return
}
_stopEventsService()
{
_set_java_home
cd "$EVENTS_SERVICE_HOME"
./bin/events-service.sh stop
return
}
_startEUM()
{
echo "Checking Events service. Please wait..."
if _isESRunning ;
then
cd "$EUM_HOME/eum-processor"
./bin/eum.sh start &
else
echo "Events service is not running. Please check Events service logs for error. Aborting EUM start."
fi
return
}
_stopEUM()
{
cd "$EUM_HOME/eum-processor"
./bin/eum.sh stop
sleep 10
return
}
########################
case $1 in
start)
_startController
_startEventsService
_startEUM ;;
stop)
_stopEUM
_stopEventsService
_stopController ;;
*)
echo "usage: appd.sh [start|stop] <4.x.x.x>"
echo ;;
esac
# go back to your directory where you started
cd $CURRENT_DIR
exit 0