Note: This article was originally published in 2013. Some steps, commands, or software versions may have changed. Check the current New Relic documentation for the latest information.

In this step-by-step guide, you’ll learn uninstall the new relic agent for a web app.

How to: Uninstall the New Relic agent for a Web App

The New Relic agent is a powerful lightweight agent that helps you monitor the performance of your Web Application. Thanks to it you can identify potential problems, measure performance, and deliver a better user experience. So why would you want to uninstall it? Well, in my case I was playing with a bunch of plugins that created a bunch of “apps” out of my main web app. Long term this is desirable as I can measure the performance of my overall deployment but also subsite by subsite I can see how the server is behaving. The only issues is that as I was playing with this functionality I switch the naming of the applications and different plugins created different apps. In one case each subsite had 3 sites: the regular one, the admin one, and I believe an ajax one… too much for me. So at the end of the day like 10 sites, 5 flavors of each… a nightmare. Now, New Relic won’t let you delete an application that is active and it won’t merge sites… so the only option is to uninstall the New Relic plugin for like an hour so that their site lets you delete your apps.

Uninstalling the agent

Note: Make sure your applications are not reporting any data (their “traffic light” status is gray) before uninstalling the agent.

Java

To remove the Java agent:

  1. Delete the newrelic folder from your app server’s root.
  2. Delete the New Relic Java options variable from your startup script.

For more information about installation, see (https://docs.newrelic.com/docs/java/new-relic-for-java).

.NET

To remove the .NET agent:

  1. Click Start > All Programs > New Relic .NET Agent.
  2. Click Uninstall the .NET agent.
  3. Follow the prompts to complete the uninstallation.

This process will leave your newrelic.config file untouched. For more information about installation, see (https://docs.newrelic.com/docs/dotnet/new-relic-for-net).

PHP

To remove the PHP agent and leave the configuration file intact (in case you want to reinstall the agent), execute thenewrelic-install script (as root): sudo /usr/bin/newrelic-install To fully remove the agent, include the purge option. This will remove everything from your system: sudo /usr/bin/newrelic-install purge For more information, see (https://docs.newrelic.com/docs/php/the-newrelic-install-script) and (https://docs.newrelic.com/docs/php/new-relic-for-php).

Python

To uninstall your Python agent, use one of these methods:

  • If installed with PIP: pip uninstall newrelic/.
  • If installed with easy_install: easy_install -m newrelic.

For more information about installation, see (https://docs.newrelic.com/docs/python/new-relic-for-python).

Ruby

To remove the Ruby agent from your Rails application, remove the newrelic.yml file from within yourRAILS_ROOT/config/ file. To remove New Relic from your Gemfile:

  1. Delete this line: gem 'newrelic_rpm'.
  2. Run bundle install.

For more information about installation, see (https://docs.newrelic.com/docs/ruby/new-relic-for-ruby).

Server monitor

To uninstall New Relic from your server monitor, use one of these methods as applicable. If you are using…Do this…
RedHat and CentOSBe sure to execute the command as root. For more information about server monitor installation, see (https://docs.newrelic.com/docs/server/server-monitor-installation-redhat-and-centos).
Yumyum remove newrelic-sysmond
RPMrpm -ev newrelic-sysmond
Ubuntu and DebianBe sure to execute the command as root. For more information about server monitor installation, see (https://docs.newrelic.com/docs/server/server-monitor-installation-ubuntu-and-debian).
aptapt-get remove newrelic-sysmond
dpkgdpkg -r newrelic-sysmond
WindowsFor more information about server monitor installation, see (https://docs.newrelic.com/docs/server/server-monitor-installation-windows).
RecommendedUse the Uninstall shortcut that is included in the Windows Start > New Relic Server Monitor folder. Follow the prompts to complete the uninstallation process.
OptionalYou can also use the command line: msiexec /x NewRelicServerMonitor-.msi /L*v uninstall.log

(http://img.zemanta.com/zemified_e.png?x-id=f65f69c7-c85a-4456-b8fe-46e339bd1324)](http://www.zemanta.com/?px “Enhanced by Zemanta”)

Summary

You’ve successfully learned uninstall the new relic agent for a web app. If you run into any issues, double-check the prerequisites and ensure your New Relic environment is properly configured.