Skip to content
Multi-Plugin python-based Agent for NewRelic's Platform
Find file
Pull request Compare This branch is 300 commits behind MeetMe:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


An agent that polls supported backend systems and submits the results to the NewRelic platform. Currently supported backend systems are:

  • Apache HTTP Server
  • CouchDB
  • Edgecast CDN "Realtime" API
  • Memcached
  • MongoDB
  • Nginx
  • pgBouncer
  • PostgreSQL
  • RabbitMQ
  • Redis
  • Riak

Installation Instructions

  1. Install via pip*:

    pip install newrelic-plugin-agent

  1. Copy the configuration file example from /opt/newrelic_plugin_agent/etc/newrelic/newrelic_plugin_agent.cfg to /etc/newrelic/newrelic_plugin_agent.cfg and edit the configuration in that file.

  2. Run the app:

    newrelic_plugin_agent -c PATH-TO-CONF-FILE [-f]

Where -f is to run it in the foreground instead of as a daemon.

Sample configuration and init.d scripts are installed in /opt/newrelic_plugin_agent

Installing Additional Requirements

To use the MongoDB, pgBouncer or PostgreSQL plugin you must install the psycopg2 library. To easily do this, make sure you have the latest version of pip installed ( This should be done after installing the agent itself.

Once installed, from inside the source directory run the following command:

pip install -e .[mongodb]


pip install -e .[pgbouncer]


pip install -e .[postgresql]

Apache HTTPd Installation Nodes

Enable the HTTPd server status page in the default virtual host. The following example configuration snippet for Apache HTTPd demonstrates how to do this:

<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from all

The agent requires the exteneded information to parse metrics. If you are not seeing any metrics on your graphs for Apache verify that you have enable ExtendedStatus, the default is off so you must enable it. In your global Apache HTTP configuration you need to enable exetended status using:

ExtendedStatus On

MongoDB Installation Nodes

You need to install the pymongo driver, either by running "pip install pymongo" or by following the "Installing Additional Requirements" above. Each database you wish to collect metrics for must be enumerated in the configuration.

Nginx Installation Notes

Enable the nginx stub_status setting on the default site in your configuration. The following example configuration snippet for Nginx demonstates how to do this:

  location /nginx_stub_status {
    stub_status on;

pgBouncer Installation Notes

The user specified must be a stats user.

PostgreSQL Installation Notes

The user specified must have the ability to query the PostgreSQL system catalog.

RabbitMQ Installation Notes

The user specified must have access to all virtual hosts you wish to monitor and should have either the Administrator tag or the Monitor tag.

Redis Installation Notes

For Redis daemons that are password protected, add the password configuration value, otherwise omit it.

Configuration Example

%YAML 1.2
  license_key: REPLACE_WITH_REAL_KEY
  poll_interval: 60

    name: hostname
    host: localhost
    port: 80
    path: /server-status

    name: localhost
    host: localhost
    port: 5984

    name: My Edgecase Account
    account: ACCOUNT_NUMBER
    token: API_TOKEN

    name: hostname
    host: localhost
    port: 27017
      - database_name_1
      - database_name_2
      - etc

    name: localhost
    host: localhost
    port: 11211

    name: hostname
    host: localhost
    port: 80
    path: /nginx_stub_status

    host: localhost
    port: 6000
    user: stats

    host: localhost
    port: 5432
    user: postgres
    dbname: postgres

    name: rabbitmq@localhost
    host: localhost
    port: 15672
    username: guest
    password: guest

    - name: localhost
      host: localhost
      port: 6379
      db_count: 16
      password: foobar

    name: localhost
    host: localhost
    port: 8098

  pidfile: /var/run/newrelic/

      format: '%(levelname) -10s %(asctime)s %(process)-6d %(processName) -15s %(threadName)-10s %(name) -25s %(funcName) -25s L%(lineno)-6d: %(message)s'
      class : logging.handlers.RotatingFileHandler
      formatter: verbose
      filename: /var/log/newrelic/newrelic_plugin_agent.log
      maxBytes: 10485760
      backupCount: 3
      level: INFO
      propagate: True
      handlers: [console, file]
      level: ERROR
      propagate: True
      handlers: [console, file]


If the installation does not install the "newrelic_plugin_agent" application in /usr/bin then it is likely that setuptools or distribute is not up to date. The following commands can be run to install distribute and pip for installing the application:

curl | python
curl | python

If the application installs but doesn't seem to be submitting status, check the logfile which at /tmp/newrelic_plugin_agent.log if the default example logging configuration is used.

Something went wrong with that request. Please try again.