forked from jelastic-jps/new-relic-apm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manifest.jps
159 lines (139 loc) · 6.76 KB
/
manifest.jps
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
type: update
jpsVersion: 0.5
id: newrelic-apm
targetEditions: [ "devops", "wordpress", "lite_do", "lite_vultr", "lite_gc", "ultimate", "light", "business" ]
targetNodes:
nodeType:
- apache
- apache2
- litespeedphp
- lemp
- llsmp
- nginxphp
- nginxphp-dockerized
- tomcat
- tomcat6
- tomcat7
- tomcat8
- tomcat9
- tomee
- tomee-dockerized
- jetty
categories:
- apps/dev-tools
- apps/popular
- apps/management-and-monitoring
- apps/dev-and-admin-tools
name: New Relic APM
version: 3.6
homepage: https://newrelic.com/
baseUrl: https://raw.githubusercontent.com/jelastic-jps/newrelic-apm/master
logo: /images/newrelic_70x70.png
description:
short: Monitor and troubleshoot your Java/PHP web apps
text: New Relic Agent is a tool for the advanced monitoring of your Java or PHP
app’s performance based on a number of application server metrics like response
time, throughput, error rates, data transfer size, etc. It allows to gather and
analyze the corresponding data within your New Relic account for diagnosing possible
problems in your project's productivity and boosting its efficiency.<br><div style="margin-top:10px">The
New Relic add-on can be installed to Java and PHP web servers.</div>
menu:
- caption: Update Agent
procedure: updateAgent
confirmText: This option will check for the New Relic Agent updates. Would you like to continue?
successText: The New Relic add-on was updated. Please, restart your web server instance for the changes to be applied.
loadingText: Performing NewRelic update...
settings:
fields:
- type: string
name: app_name
caption: Application name
required: true
default: "${env.domain}"
regex: "^[\\w-.]*$"
regexText: without special characters
- type: string
name: license_key
caption: License key
vtype: alphanum
vtypeText: Alphanumeric input only.
required: true
default: '0000000000000000000000000000000000000000'
onInstall:
checkEngine:
action: install
onUninstall:
checkEngine:
action: uninstall
onAfterRedeployContainer:
checkEngine:
action: install
onAfterAddNode:
checkEngine:
action: install
actions:
updateAgent:
checkEngine:
action: update
updateJavaAgent:
cmd[${targetNodes.nodeGroup}]: |-
curl -fsSL '${baseUrl}/scripts/newRelicUpdate.sh' -o /tmp/newrelicUpdateJava.sh >> /var/log/newrelic.log 2>&1
bash /tmp/newrelicUpdateJava.sh "${SERVER_LIBS}" "${settings.license_key}" "${settings.app_name}" >> /var/log/newrelic.log 2>&1
user: root
updatePhpAgent:
cmd[${targetNodes.nodeGroup}]: |-
PHPVER=$(php -v | grep "^PHP" | awk '{print $2}' | awk -F. '{print $1"."$2}');
PHPZTS=$(php -i | grep "\-\-enable\-zts" -q; if [ $? -eq 0 ]; then echo "-zts"; fi);
NEWRELICVER="newrelic-php5";
if (( $(echo "$PHPVER 8.2" | awk '{print ($1 < $2)}') )); then if [ ! -z "$PHPZTS" ]; then NEWRELICVER="newrelic-php5-9.19.0.309-1"; fi; fi;
if [ "$NEWRELICVER" == "newrelic-php5" ]; then yum update --nogpgcheck -y newrelic-php5 >> /var/log/newrelic.log 2>&1; else yum --nogpgcheck -y install $NEWRELICVER >> /var/log/newrelic.log 2>&1; fi
newrelic_pid=$(pidof -s newrelic-daemon);
[[ ! -z $newrelic_pid ]] && killall -9 newrelic-daemon || echo "newrelic-daemon is absent";
user: root
uninstallJavaAgent:
cmd[${targetNodes.nodeGroup}]: |-
curl -fsSL '${baseUrl}/scripts/uninstallJava.sh' -o /tmp/uninstallJava.sh >> /var/log/newrelic.log 2>&1
bash /tmp/uninstallJava.sh "${SERVER_LIBS}" >> /var/log/newrelic.log 2>&1
user: root
uninstallPhpAgent:
cmd[${targetNodes.nodeGroup}]: |-
yum --nogpgcheck -y remove newrelic*
echo "php_ini=`php -i | grep 'Loaded Configuration File' | grep -oP '(?<=\=\>\s).*'`" >> /tmp/php_conf
source /tmp/php_conf && sed -ir "s|.*newrelic.*||g" $php_ini
user: root
installPhpAgent:
- cmd [${targetNodes.nodeGroup}]: |-
PHPVER=$(php -v | grep "^PHP" | awk '{print $2}' | awk -F. '{print $1"."$2}');
PHPZTS=$(php -i | grep "\-\-enable\-zts" -q; if [ $? -eq 0 ]; then echo "-zts"; fi); export PHPZTS;
if (( $(echo "$PHPVER 8.1" | awk '{print ($1 > $2)}') )); then if [ ! -z "$PHPZTS" ]; then echo "Issue: Newrelic can't be installed on this node because ZTS is enabled and the PHP version is higher than 8.1 (the last zts supported version by Newrelic)"; exit 0; fi; fi;
if (( $(echo "$PHPVER 8.2" | awk '{print ($1 < $2)}') )); then NEWRELICVER="newrelic-php5-9.19.0.309-1"; else NEWRELICVER="newrelic-php5"; fi
if [ -z "$(rpm -qa | grep newrelic-repo-5-3)" ]; then rpm -Uvh http://yum.newrelic.com/pub/newrelic/el5/i386/newrelic-repo-5-3.noarch.rpm >> /var/log/newrelic.log 2>&1; fi
if [ -z "$(rpm -qa | grep newrelic-php5)" ]; then yum --nogpgcheck -y install $NEWRELICVER >> /var/log/newrelic.log 2>&1; fi
NRBASEDIR=/usr/lib/newrelic-php5; export NRBASEDIR
MODULEDIR=/usr/lib64/php/modules;
[ ! -d $MODULEDIR ] && MODULEDIR="/usr/local/lsws/lsphp/lib64/php/modules/";
PHPINIDIR="/etc/php.d/"
[ ! -d $PHPINIDIR ] && PHPINIDIR="/usr/local/lsws/lsphp/etc/php.d/"
export MODULEDIR
ARCH=x64; export ARCH
PHPAPI=$(php -i | grep "PHP API" | awk '{print $4}'); export PHPAPI
rm -f $MODULEDIR/newrelic.so
ln -s $NRBASEDIR/agent/$ARCH/newrelic-${PHPAPI}${PHPZTS}.so $MODULEDIR/newrelic.so
export NR_INSTALL_KEY="${settings.license_key}" && export NR_INSTALL_SILENT=true && /usr/bin/newrelic-install install
sed -i 's|newrelic.appname = \"PHP Application\"|newrelic.appname = \"${settings.app_name}\"|g' $PHPINIDIR/newrelic.ini
sed -i 's|newrelic.license = ".*"|newrelic.license = "${settings.license_key}"|g' $PHPINIDIR/newrelic.ini
user: root
- if (response.out.indexOf("Issue") !== -1):
message: ${response.out}
script: |
return {"result": "info", message: message.replace(/\n/g, ' \n')}
checkEngine:
script: /scripts/checkEngineNodes.js
installJavaAgent:
cmd[${targetNodes.nodeGroup}]: |-
curl -fsSL '${baseUrl}/scripts/NewRelicJavaNew.sh' -o /tmp/newrelicJava.sh >> /var/log/newrelic.log 2>&1
bash /tmp/newrelicJava.sh "${SERVER_LIBS}" "${settings.license_key}" "${settings.app_name}" >> /var/log/newrelic.log 2>&1
user: root
success: The installation has been successfully completed. Please, restart your web server instance to apply the changes.
After that, you can navigate to your New Relic control panel and explore your app's performance data. **[More info](https://newrelic.com/platform/application-monitoring)**
Refer to the **[Troubleshooting](https://docs.newrelic.com/docs/new-relic-solutions/solve-common-issues/troubleshooting/not-seeing-data)** guide in case you face any issues with New Relic APM usage or installation.