17 Uninstall APM Agent
A user with Application Performance Monitoring administrator role can uninstall the APM Agent.
Topics:
Uninstall APM Java Agent
This section discusses how you can uninstall APM Java Agents.
- Remove APM Java Agents from Oracle WebLogic Server
- Remove APM Java Agents from WebSphere
- Remove APM Java Agents from Apache Tomcat
- Remove APM Java Agents from JBoss
- Remove APM Java Agents from Jetty
Remove APM Java Agents from Oracle WebLogic Server
To disable and remove APM Java Agents from a WebLogic domain, complete the following tasks:
-
Task 1: Disable the APM Java Agent in the WebLogic Server Domain
-
Stop the WebLogic Server:
% cd $DOMAIN_HOME/bin % ./stopWebLogic.sh
-
Remove the edited version of the
startWebLogic.sh
script, and replace it with the original script that was backed up before you installed the APM Java Agent:% mv startWebLogic.sh.orig startWebLogic.sh
-
Restart the WebLogic Server:
% cd $DOMAIN_HOME % nohup ./startWebLogic.sh >& startup.log &
Note:
Note that in the above script you are using the
$DOMAIN_HOME
version ofstartWebLogic.sh
, even though you had earlier edited the$DOMAIN_HOME/bin
version. Invoking this script from one level higher will in fact invoke the script from a lower level.
-
-
Task 2: Delete the APM Java Agent Software from the WebLogic Server Domain
-
Remove the directory where the APM Java Agent files were extracted:
% cd $DOMAIN_HOME % rm -r apmagent
-
Remove the directory where you initially extracted the APM Java Agent installation software.
-
-
Task 3: Remove APM Java Agent References from Oracle Management Cloud
-
On the Oracle Management Cloud Agents page, click APM Agents on the left navigation pane.
-
On the APM Agents page, select the APM Java Agent that you want to remove. Use the Search feature to search for a specific APM Java Agent.
-
On the right side of the page, click the Actions menu and select Remove.
-
Remove APM Java Agents from WebSphere Server
To disable and remove APM Java Agents from your WebSphere application server, complete the following tasks:
-
Task 1: Disable the APM Java Agent in the WebSphere Server
-
From your WebSphere Admin console, click the Servers tab and select the server on which you want to provision the APM Java Agent.
-
Expand Java and Process Management tab and select Process Definition.
-
Under Additional Properties tab, select Java Virtual Machine.
-
In the Generic JVM arguments field, remove the following line:
-javaagent:\$WAS_HOME/apmagent/lib/system/ApmAgentInstrumentation.jar -Dws.ext.dirs=\$WAS_HOME/apmagent/lib/agent/ApmEumFilter.jar
-
Remove the edited version of the
server.policy
file, and replace it with the original script that was backed up before you installed the APM Java Agent:% mv server.policy.sh.orig server.policy.sh
-
Restart the WebSphere Server:
% cd $WAS_HOME/bin ./stopServer.sh <servername> ./startServer.sh <servername>
Note:
Note that in the above script you are using the
$WAS_HOME
version of theserver.policy
file, even though you had earlier edited the$WAS_HOME/bin
version. Invoking this script from one level higher will in fact invoke the script from a lower level.
-
-
Task 2: Delete the APM Java Agent Software from the WebSphere Server
-
Remove the directory where the APM Java Agent files were extracted:
% cd $WAS_HOME % rm -r apmagent
-
Remove the directory where you initially extracted the APM Java Agent installation software.
-
-
Task 3: Remove APM Java Agent References from Oracle Management Cloud
-
On the Oracle Management Cloud Agents page, click APM Agents on the left navigation pane.
-
On the APM Agents page, select the APM Java Agent that you want to remove. Use the Search feature to search for a specific APM Java Agent.
-
On the right side of the page, click the Actions menu and select Remove.
-
Remove APM Java Agents from Apache Tomcat
To disable and remove APM Java Agents from your Apache Tomcat application server, complete the following tasks:
-
Task 1: Disable the APM Java Agent in the Apache Tomcat Server
-
Stop the Apache Tomcat Server:
% cd $CATALINA_HOME/bin % ./shutdown.sh
-
Remove the edited version of the
catalina.sh
file, and replace it with the original script that was backed up before you installed the APM Java Agent:% mv catalina.sh.orig catalina.sh
-
Restart the Tomcat Server:
% cd $CATALINA_HOME/bin % ./shutdown.sh % ./startup.sh
Note:
Note that in the above script you are using the
$CATALINA_HOME
version of thecatalina.sh
file, even though you had earlier edited the$CATALINA_HOME/bin
version. Invoking this script from one level higher will in fact invoke the script from a lower level.
-
-
Task 2: Delete the APM Java Agent Software from the Tomcat Server
-
Remove the directory where the APM Java Agent files were extracted:
% cd $CATALINA_HOME % rm -r apmagent
-
Remove the directory where you initially extracted the APM Java Agent installation software.
-
-
Task 3: Remove APM Java Agent References from Oracle Management Cloud
-
On the Oracle Management Cloud Agents page, click APM Agents on the left navigation pane.
-
On the APM Agents page, select the APM Java Agent that you want to remove. Use the Search feature to search for a specific APM Java Agent.
-
On the right side of the page, click the Actions menu and select Remove.
-
Remove APM Java Agents from JBoss
To disable and remove APM Java Agents from your JBoss application server, complete the following tasks:
-
Task 1: Disable the APM Java Agent in the JBoss Server
-
Stop the JBoss Server:
% cd $JBOSS_HOME/bin % ./jboss-cli.sh -c :shutdown
-
Remove the edited version of the
standalone.conf
file, and replace it with the original script that was backed up before you installed the APM Java Agent:% mv standalone.conf.orig standalone.conf
-
Restart the JBoss Server:
% cd $JBOSS_HOME/bin % ./jboss-cli.sh -c :shutdown % nohup ./standalone.sh -b 0.0.0.0&> startup.log &
Note:
Note that in the above script you are using the
$JBOSS_HOME
version of thestandalone.conf
file, even though you had earlier edited the$JBOSS_HOME/bin
version. Invoking this script from one level higher will in fact invoke the script from a lower level.
-
-
Task 2: Delete the APM Java Agent Software from the Tomcat Server
-
Remove the directory where the APM Java Agent files were extracted:
% cd $CATALINA_HOME % rm -r apmagent
-
Remove the directory where you initially extracted the APM Java Agent installation software.
-
-
Task 3: Remove APM Java Agent References from Oracle Management Cloud
-
On the Oracle Management Cloud Agents page, click APM Agents on the left navigation pane.
-
On the APM Agents page, select the APM Java Agent that you want to remove. Use the Search feature to search for a specific APM Java Agent.
-
On the right side of the page, click the Actions menu and select Remove.
-
Remove APM Java Agents from Jetty
To disable and remove APM Java Agents from your Jetty application server, complete the following tasks:
-
Task 1: Disable the APM Java Agent in the Jetty Server
-
Stop the Jetty Server.
Remove the edited version of thejava -jar start.jar
file, and replace it with the original script that was backed up before you installed the APM Java Agent:% mv java -jar start.jar.orig java -jar start.jar
-
Restart the Jetty Server.
Note:
Note that in the above script you are using the
$JETTY_HOME
version of thejava -jar start.jar
file, even though you had earlier edited the$JETTY_HOME/bin
version. Invoking this script from one level higher will in fact invoke the script from a lower level.
-
-
Task 2: Delete the APM Java Agent Software from the Jetty Server
-
Remove the directory where the APM Java Agent files were extracted:
% cd $JETTY_HOME % rm -r apmagent
-
Remove the directory where you initially extracted the APM Java Agent installation software.
-
-
Task 3: Remove APM Java Agent References from Oracle Management Cloud
-
On the Oracle Management Cloud Agents page, click APM Agents on the left navigation pane.
-
On the APM Agents page, select the APM Java Agent that you want to remove. Use the Search feature to search for a specific APM Java Agent.
-
On the right side of the page, click the Actions menu and select Remove.
-
Uninstall APM .Net Agent
This section discusses how you can uninstall APM .Net Agents.
Remove APM .Net Agent
-
Task 1: Remove APM .Net Agent
-
Task 2: Remove APM .NET Agent References from Oracle Management Cloud
Task 1: Remove APM .Net Agent
-
Stop the IIS server.
iisreset /stop
-
You can remove APM .Net Agent in any of the following ways:
-
Navigate to the installation directory and run the
ApmAgent.msi
executable. The APM .Net Agent uninstallation wizard guides you through the uninstallation process.OR
-
Navigate to the Control Panel and remove Oracle APM .NET Agent.
-
-
For silent uninstallation, run the following command from the installation directory:
msiexec /quiet /log uninstall.log /x ApmAgent.msi
-
If you did not stop the IIS server before you started the uninstallation, the uninstallation wizard displays a message that the
APMAgent\config
folder and the related.json
files have not been deleted. Delete this folder and the.json
files manually to remove all the configuration settings. If the folder is not deleted, these configuration settings will be used the next time you install Application Performance Monitoring.
Task 2: Remove APM .NET Agent References from Oracle Management Cloud
-
On the Oracle Management Cloud Agents page, click APM Agents on the left navigation pane.
-
On the APM Agents page, select the APM .Net Agent that you want to remove. Use the Search feature to search for a specific APM .Net Agent.
-
On the right side of the page, click the Actions menu and select Remove.
Uninstall APM Node.js Agent
This section discusses how you can uninstall APM Node.js Agents.
Upgrade APM Node.js Agent
-
Ensure that the environment variables are set appropriately.
-
Ensure that none of the files in the
node_modules/oracle-apm
folder are open. -
Stop all the APM Node.js Applications.
-
Ensure you are logged in as the same user that installed the initial APM Node.js Agent.
To upgrade APM Node.js Agents:
-
Download the latest APM Node.js Agent software.
-
Extract the contents of the ZIP file to a local or shared directory.
-
Download the agent install software.
For information on the above steps 1 to 3, see Installing and Configuring APM Node.js Agents. -
Optionally, backup the existing APM Node.js Agent from
$NODE_PATH
. -
Install and provision the APM Node.js Agent by running the provisioning script.
APM Node.js Agent displays the list of changes made by the upgrade process, and prompts for confirmation. On confirmation, the APM Node.js Agent is upgraded to the new version, and all customized properties are retained. The
oracle-apm
directory and theoracle-apm-config.json
file in$NODE_PATH
are backed up to${STAGE_DIR}/temp
.Note:
Review the
hostName
property, since this value will overwrite thehostName
which was used by the agent prior to upgrade.The upgrade computes a default
hostname
and uses the same. To override this default, rerun the provisioning script withORACLE_HOSTNAME
argument.
-
A new version of APM Node.js Agent software will be installed in the
node-modules
folder. -
Updated
oracle-apm-config.json
will be copied over fromSTAGE_DIR
tonode-modules/oracle-apm/data
folder. Existing file will be backed up with a.backup
extension. Custom properties edited previously likeproxy params
etc will be copied over to the new file. -
All
.cer
certificate files will be converted into the correct format and copied over tonode-modules/oracle-apm/data
folder. -
Start the Node.js applications. The required
config
files will be copied to the respectiveNODE_APP_HOME/oracle-apm/data
folder.
Troubleshooting Upgrade Issues
The upgrade overwrites oracle-apm
agent files in the %NODE_PATH%
folder. If any file from this folder (for example, oracle-apm-config.json
file) is open during the upgrade, the following npm
error occurs, and the upgrade process stops.
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename '%NODE_PATH%\oracle-apm' -> '%NODE_PATH%\.oracle-apm.DELETE'
With the above error, the oracle-apm
folder is deleted and hence, a rerun of the script is treated as a new install. Any locally modified properties are lost due to the rerun.
Workaround
Follow this workaround before attempting a rerun of the provisioning script:
-
The backup copy of the old
oracle-apm
folder is available in the backup folder -${STAGE_DIR}/temp
(on Linux) and%TEMP% folder
(on Windows). Copy this folder intonode_modules.
-
Ensure that none of the files from the
node_modules/oracle-apm
folder are open, and rerun the provisioning script.
Remove APM Node.js Agent
-
Task 1: Remove the APM Node.js Agent from the application
-
Task 2: Delete APM Node.js files from the Application folder
-
Task 3: Uninstall APM Node.js Agent
Task 1: Remove the APM Node.js Agent from the application
-
Navigate to the
NODE_APP_HOME
folder. -
Open the .js file that serves as the application’s entry point.
-
In the .js file, search for the line that starts with
require('oracle-apm');
and delete it.Code with Node.js Agent enabled:require('oracle-apm'); //Newly added require for Oracle APM instrumentation var express = require('express'); var app = express(); app.get('/', function (req, res) { res.send('Hello World!'); }); app.listen(3000, function () { console.log('Example app listening on port 3000!'); });
Code after removing APM Node.js Agentvar express = require('express'); var app = express(); app.get('/', function (req, res) { res.send('Hello World!'); }); app.listen(3000, function () { console.log('Example app listening on port 3000!'); });
Task 2: Delete APM Node.js files from the Application folder
-
Navigate to the
NODE_APP_HOME
folder. -
Remove the directory
oracle-apm
where APM Node.js Agent was installed.cd $NODE_APP_HOME rm -r oracle-apm
Task 3: Uninstall APM Node.js Agent
-
Set the environment variable PATH to include
$Node_Home/bin
. -
Run the following command to uninstall APM Node.js Agent:
npm uninstall -g oracle-apm
Uninstall APM Ruby Agent
Follow these steps to uninstall the APM Ruby Agent.
Remove APM Ruby Agent
-
Edit the application’s Gemfile and either comment out or remove the gem reference:
gem 'oracle_apm', '~> 1.x.x’
-
Restart your application server.
-
Remove the agent gem from the gem library:
gem uninstall oracle_apm
-
To remove the Agent from the Oracle Management Cloud UI, in the Oracle Management Cloud Agents page, click APM Agents on the left navigation pane.
-
In the APM Agents page, select the APM Agent that you want to remove. Click the Actions menu and select Remove.
Disable and Remove Agents for Licensing Purposes
Charges for APM usage vary by licensing model.
In the Universal Credits licensing model, APM Agents are counted based on the amount of data received, and not on the number of registered APM Agents. In this licensing model, you simply need to stop data from being received by Oracle Management Cloud in order to stop or pause charging. You do not have to completely remove the APM Agents in this case. To stop data transfer, you can do ONE of the following:
- Disable APM data being sent to OMC: If you are using a Gateway, first disable End User Monitoring (EUM) (by setting the End User Monitoring Injection Type Property to None) using the APM Console and then stop the gateway agent. To deploy APM agents using gateways, refer to installation instructions for your type of agent. For detailed instructions on how to turn off EUM, see Enable and Configure End User Monitoring.
- Stop the Application Server. Data will no longer be sent to OMC.
- Remove APM Agents. For instructions on how to remove APM agents, see Upgrade APM Agents.
- Stop, Disable and then Remove the APM Agents so that data is no longer sent to OMC. For instructions on how to remove APM agents, see Upgrade APM Agents.