Uninstalling your agents

Uninstall a single agent or all the agents from a managed system.

Before you begin

For multi-instance agents, you must remove all agent instances before you uninstall the agent. Otherwise, agent entries are not cleared from the registry. To remove instances, run the following command:
  • Windowsname-agent.bat remove instance_name
  • Linux or AIX./name-agent.sh remove instance_name
where, name is the name of the agent and instance_name is the instance name. For more information, see Using agent commands. For a list of multiple-instance agents, see Table 1.
For the following agents, an agent-specific task must be completed before you complete the uninstallation procedure:
  • For the Monitoring Agent for HTTP Server, you must delete the Include statement in the http.conf file, for example, "Include "/opt/ibm/apm/agent/tmp/khu/kvm65s2_8044.conf", before you restart the IBM® HTTP server.
  • For the Monitoring Agent for Python, run install_dir/lx8266/pg/bin/uninstall.sh to remove injection codes before you uninstall the agent.
  • For the Monitoring Agent for PHP, run install_dir/bin/lx8266/pj/lib/uninstall.instance_name.sh to move injection codes before you uninstall the agent.
  • For the Monitoring Agent for WebSphere® Applications, you must unconfigure the data collector for all monitored server instances before you uninstall the agent. Follow the instructions in WebSphere Applications agent: Unconfiguring the data collector.
    For the WebSphere Applications agent, make sure that the user ID, which is used to uninstall the agent, has full read and write permissions to the logs and runtime directories and all their contained subdirectories and files within the data collector home directory. The data collector home directory is as follows:
    • Windowsinstall_dir\dchome\7.3.0.14.08
    • Linux or AIXinstall_dir/yndchome/7.3.0.14.08
  • For the Node.js agent, you must remove the monitoring plug-in from your Node.js application before you uninstall the agent. Follow the instructions in Node.js agent: Removing the monitoring plug-in.
  • For the Microsoft .NET agent, you must complete the following before you uninstall the agent:
    1. Disable the modules for .NET Core Applications. Follow the instructions in Disabling Modules for .NET Core Applications.
    2. Remove the data collector from your .NET applications. Follow the instructions in Microsoft .NET agent: Removing the .NET data collector.
  • For the IBM Integration Bus agent, if you configured transaction tracking for brokers with the agent provided user exit, you must remove the user exit before you uninstall the agent. Follow the instructions in Removing the KQIUserExit user exit.
  • For the Internet Service Monitoring, go to <candle_home>\BIN and run the ism-agent.bat file with uninstall as an argument. In case you want to uninstall all monitoring agents on the server using smai-agent.bat, first run the ism-agent.bat with uninstall as an argument and then run the smai-agent.bat
  • For the Monitoring Agent for SAP NetWeaver Java™ Stack, before you uninstall the agent, stop all SAP NetWeaver Java Stack agent instances by using the following command:
    • Windowssap_netweaver_java_stack-agent.bat stop instance_name

About this task

The Oracle agent on Windows systems can be uninstalled only by using the command prompt.

Procedure

  1. On the VM or system where the monitoring agent (or agents) is installed, start a command line and change to the binary directory:
    • Linux or AIXinstall_dir/bin
    • Windowsinstall_dir\BIN
    where install_dir the installation directory of the monitoring agent or agents.
  2. To uninstall a specific monitoring agent, enter the agent script name and the uninstall option where name is the agent script name:
    • Linux or AIX./name-agent.sh uninstall
    • Windowsname-agent.bat uninstall
    For a list of the agent script names, see Using agent commands.
    Remember: For the Monitoring Agent for Microsoft .NET, you must run the command with Administrator privileges.

    The monitoring agent is uninstalled from the managed system.

    If you have uninstalled all of your monitoring agents individually, continue to remove the framework files. See What to do next.

  3. To uninstall all the monitoring agents from the managed system with a confirmation prompt, enter the script name and uninstall all option:
    • Linux or AIX./smai-agent.sh uninstall_all
    • Windowssmai-agent.bat uninstall_all
    A confirmation prompt is displayed. Type 1 to continue, or type 2 to cancel.
    All monitoring agents are uninstalled from the system or VM.
  4. Linux or AIX On Linux®, and UNIX, to force the uninstall of all the monitoring agents without a prompt for confirmation, enter the script name and the force uninstall all option:
    ./smai-agent.sh uninstall_all force

What to do next

For the Monitoring Agent for HTTP Server, after you uninstall the agent, you must remove the following files manually:
  • /tmp/khu_cps.properties
  • /tmp/httpserver-disc.error
For the Monitoring Agent for Python:
  1. Delete the Django pyc configuration file to ensure the restored Django pyc file generates its binary.
  2. Restart the Apache server to remove the loaded middleware in the Apache processes.
For the Monitoring Agent for Ruby, to uninstall the diagnostics data collector:
  1. Navigate to the home directory of your application, open its Gemfile, and remove the following line from the file: gem 'stacktracer'
  2. Restart your Ruby on Rails application.
  3. Uninstall the diagnostics data collector. Enter: gem uninstall Gemfile
  4. Remove the runtime directory of the data collector. The default location of this directory is install_dir/install-images/kkm/dchome
For the Monitoring Agent for Microsoft .NET, complete these steps:
  1. Remove the data collector dll files using one of the following options:
    • Reboot your operating system.
    • Try to delete the file install_dir\qe\bin64\CorProfLog.dll.

      A File in Use dialog is displayed. It identifies the .NET processes that are currently running.

    • Restart each of the .NET processes.
  2. Restart your .NET applications.