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 |
---|---|---|
| Required | Your New Relic user key. |
| Required | |
| Required | List of targeted installs to run on hosts. Available options are:
|
| Optional | The data center region for your organization ( |
| Optional | Sets the proxy server the agent should use. |
| Optional | Specifies command output verbosity Supported values include
|
| Optional | Key value pair tags added through custom attributes. |
| Optional | Sets the timeout in seconds for New Relic installations. Defaults to |