• EnglishEspañol日本語한국어Português
  • Log inStart now

Configure the infrastructure agent using Chef

Read on to learn how to use New Relic's Chef recipes to install and configure New Relic's infrastructure agent. For how to use Chef recipes, see the Chef docs.

The New Relic cookbook is available in the Chef Supermarket. It will help you scale your New Relic observability efforts. To achieve this, it uses the New Relic CLI and our open install repository. This is a community-supported effort.

Compatibility and requirements

Our Chef recipe has the following requirements:

  • Chef versions 15 or higher

Supported platforms:

  • Amazon Linux all versions
  • CentOS version 5 or higher
  • Debian version 7 ("Wheezy") or higher
  • Red Hat Enterprise Linux (RHEL) version 5 or higher
  • Ubuntu versions 16.04., 18.04., 20.04* (LTS versions)
  • Windows Server 2008, 2012, 2016, and 2019, and their service packs.
  • SUSE Linux Enterprise 11, 12

Chef recipes

Infrastructure monitoring has one default recipe: default. Include this recipe to install and configure the infrastructure agent, logs, and . If this recipe detects an unsupported platform or version, the Chef run fails. Configuration depends on your specific setup and standards.

Important

This cookbook will always install the latest released version of the New Relic agent and doesn't support installing older versions.

Set up New Relic with Chef

The newrelic_install resource manager will instrument New Relic using our guided install, with minimal configuration. It will:

  • Set any attributes necessary for your desired configuration
  • Add the newrelic-install::default recipe your run list

Run newrelic-install recipe

newrelic_install 'install' do
action :install
new_relic_api_key node['newrelic_install']['NEW_RELIC_API_KEY']
new_relic_account_id node['newrelic_install']['NEW_RELIC_ACCOUNT_ID']
env node['newrelic_install']['env']
targets node['newrelic_install']['targets']
end

Chef attributes

The default recipe supplies the following Chef attributes:

Name

IsRequired

Description

default['newrelic_install']['NEW_RELIC_API_KEY']

Required

Your New Relic user key.

default['newrelic_install']['NEW_RELIC_ACCOUNT_ID']

Required

The New Relic account ID

default['newrelic_install']['targets']

Required

List of targeted installs to run on hosts. Available options are:

  • infrastructure-agent-installer
  • logs-integration
  • php-agent-installer

default['newrelic_install']['NEW_RELIC_REGION']

Optional

The data center region for your organization (US or EU). Defaults to US.

default['newrelic_install']['env']['HTTPS_PROXY']

Optional

Sets the proxy server the agent should use.

default['newrelic_install']['verbosity']

Optional

Specifies command output verbosity

Supported values include

  • debug
  • trace

default['newrelic_install']['tags']

Optional

Key value pair tags added through custom attributes.

default['newrelic_install']['timeout_seconds']

Optional

Sets the timeout in seconds for New Relic installations. Defaults to 600.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.