Skip to content

claranet/puppet-newrelic

 
 

Repository files navigation

puppet-newrelic

Forge Endorsement Build Status Puppet Forge Forge Downloads

Table of Contents

  1. Description - What is the puppet-newrelic module?
  2. Setup - The basics of getting started with puppet-newrelic
  3. Usage - Configuration options and additional functionality
  4. Supported agents
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module

Description

This module manages and installs the New Relic Server Monitoring and PHP agents and is based on Felipe Salum's puppet-newrelic module.

Setup

What puppet-newrelic affects

  • Adds the upstream NewRelic Yum/Apt repositories
  • Installs the NewRelic Server/Infrastructure agent and also the PHP or .NET agents

Beginning with puppet-newrelic

To use the module in its default form, which will install the NewRelic Infra agent:

include ::newrelic

Usage

To install the (deprecated) NewRelic Server Monitoring agent instead of the default NewRelic Infrastructure agent:

class { '::newrelic':
  license_key   => 'your key here',
  enable_infra  => false,
  enable_server => true,
}

Supported Agents

PHP

To enable the PHP agent with default configuration:

class { '::newrelic':
  license_key      => 'your key here',
  enable_php_agent => true,
}

Further PHP agent configuration in Hiera:

 newrelic::agent::php::ini_settings:
   appname: 'ACME PHP Application'
   daemon.loglevel: 'error'

The below examples show how to integrate the NewRelic PHP agent with the most common web-servers, with automatic service restarts.

Apache and mod_php

Assumes usage of the Puppet Apache module.

class { '::apache': }
class { '::apache::mod::php': }

class { '::newrelic::agent::php':
  license_key => 'your key',
  require     => Class['::apache::mod::php'],
  notify      => Service['httpd'],

PHP-FPM

Assumes usage of the Slashbunny PHP-FPM module.

class { '::phpfpm':
    poold_purge => true,
}

::phpfpm::pool { 'main': }

class { '::newrelic::agent::php':
  license_key => '3522b44f4c3f89c8566d5781bac6e0bb7dedab7z',
  require     => Class['::phpfpm'],
  notify      => Class['::phpfpm::service'],
}

Java

This module installs a specified version of the the NewRelic Java agent into an install directory. The install directory is recommended to be newrelic/ under your app folder. Ensure permissions are correct on the install folder by using agent_user and agent_group.

Note: Importantly, this does not handle passing newrelic.jar to JVM_OPTS etc. Please refer to NewRelic docs here - https://docs.newrelic.com/docs/agents/java-agent/installation/install-java-agent

class { '::newrelic::agent::java:
  license_key => '3522b44f4c3f89c8566d5781bac6e0bb7dedab7z'
}

# or use hiera and include
# newrelic::agent::java::license_key: '3522b44f4c3f89c8566d5781bac6e0bb7dedab7z'
include ::newrelic::agent::java

Limitations

Supported Operating Systems

  • Debian/Ubuntu
  • CentOS/RHEL

Puppet 3

On 31st December 2016, support for Puppet 3.x was withdrawn. As as a result, this module does not support Puppet 3.

Server to Infra Migrations

When moving from NewRelic Server to NewRelic Infrastructure - the module only installs the new client, and does not clean up the old one.

Windows

Please note that Windows support is currently untested.

Development

  • Copyright (C) 2012 Felipe Salum [email protected]
  • Copyright (C) 2017 Claranet
  • Distributed under the terms of the Apache License v2.0 - see LICENSE file for details.

About

Puppet module to install New Relic Server Monitoring and PHP agents

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Puppet 55.7%
  • Ruby 27.7%
  • HTML 16.6%