Skip to content
Sanjeev Kumar Mishra edited this page Nov 28, 2017 · 9 revisions

Initial Installation

  1. Install via pip (if you need to install pip, see pip installation instructions):

pip install newrelic-plugin-agent

  1. Copy the configuration file example from /opt/newrelic_plugin_agent/newrelic_plugin_agent.cfg to /etc/newrelic/newrelic_plugin_agent.cfg and edit the configuration in that file adding your New Relic license key and uncommenting and configuring the appropriate plugins. See [Configuration] for more information on configuring the plugin.
  2. Make a /var/log/newrelic directory and make sure it is writable by the user specified in the configuration file
  3. Make a /var/run/newrelic directory and make sure it is writable by the user specified in the configuration file

Creating the service

upstart/init.d

Copy the appropriate init.d script from /opt/newrelic_plugin_agent to /etc/init.d:

Ubuntu/Debian:

cp /opt/newrelic_plugin_agent/newrelic_plugin_agent.deb /etc/init.d/newrelic_plugin_agent
chmod u+x /etc/init.d/newrelic_plugin_agent
update-rc.d newrelic_plugin_agent defaults
service newrelic_plugin_agent start

RHEL/CentOS:

cp /opt/newrelic_plugin_agent/newrelic_plugin_agent.rhel /etc/init.d/newrelic_plugin_agent
chmod u+x /etc/init.d/newrelic_plugin_agent
chkconfig newrelic_plugin_agent default
service newrelic_plugin_agent start

systemd

Create the service file /lib/systemd/system/newrelic-plugin-agent.service. Copy the content from https://github.com/MeetMe/newrelic-plugin-agent/blob/master/etc/systemd/system/newrelic-plugin-agent.service

Start the service with sudo systemctl start newrelic-plugin-agent.service.
To activate the service on boot by default, run: sudo systemctl enable newrelic-plugin-agent.service.

Installation Additional Requirements

MongoDB, PostgreSQL, pgBouncer

To use the MongoDB the mongodb library is required. For the pgBouncer or PostgreSQL plugin you must install the psycopg2 library. To easily do this, make sure you have the latest version of pip installed (http://www.pip-installer.org/). This should be done after installing the agent itself:

pip install -e newrelic_plugin_agent[mongodb]

or

pip install -e newrelic_plugin_agent[pgbouncer]

or

pip install -e newrelic_plugin_agent[postgresql]

PHP APC

Copy the apc-nrp.php script to a directory that can be served by your web server or php-fpm application. Edit the newrelic_plugin_agent configuration to point to the appropriate URL.