-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions
56 lines (49 loc) · 1.78 KB
/
functions
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
# -*-shell-script-*-
. "$genapp_functions/core"
. "$genapp_functions/ec2"
appdynamics_dir=$app_dir/appdynamics
install_appdynamics() {
echo "Installing appdynamics"
_tmp=$app_dir/appdynamics_tmp
mkdir $_tmp
unzip -qd $_tmp $plugin_dir/lib/appdynamics.zip
mv $_tmp/appdynamics $appdynamics_dir
rm -rf $_tmp
chmod 770 $appdynamics_dir
chmod -R g+w $appdynamics_dir
}
node_name() {
_meta_val=$(metadata appdynamics_node_name "")
if [ "$_meta_val" != "" ]; then
echo "$_meta_val"
else
instance_data instance-id
fi
}
app_name() {
echo "${extra_app_id#*/}" # name part of app ID (e.g. bar in foo/bar)
}
write_java_opts() {
_opts_file=$control_dir/java-opts-50-appdynamics
echo "Writing appdynamics java options to $_opts_file"
_node_name=$(node_name)
_app_name=$(app_name)
_controller_host=$(metadata appdynamics_controller_host "")
_controller_port=$(metadata appdynamics_controller_port "")
_account_name=$(metadata appdynamics_account_name "")
_access_key=$(metadata appdynamics_account_access_key "")
echo "-javaagent:$appdynamics_dir/javaagent.jar" \
"-Dappdynamics.agent.runtime.dir=$appdynamics_dir" \
"-Dappdynamics.agent.logs.dir=$appdynamics_dir" \
"-Dappdynamics.agent.applicationName=$_app_name" \
"-Dappdynamics.agent.nodeName=$_node_name" \
"-Dappdynamics.agent.tierName=$_app_name" \
"-Dappdynamics.controller.hostName=$_controller_host" \
"-Dappdynamics.controller.port=$_controller_port" \
"-Dappdynamics.agent.accountName=$_account_name" \
"-Dappdynamics.agent.accountAccessKey=$_access_key" >> $_opts_file
}
write_jboss_modules_system_pkgs() {
echo "com.singularity" \
> "$control_dir/jboss-modules-system-pkgs-appdynamics"
}