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

Tarball manual install of the infrastructure agent for Linux

Our custom Linux installation process for infrastructure monitoring allows you to tailor all aspects of the installation process, and to place files and folders on your filesystem. You have full control of the installation.

Caution

The manual install process is not supervised. If you opt for manual install, you are responsible for placing the different files in the correct folders, providing the correct parameterized configuration values, and ensuring the agent has all the permissions to execute.

Install the agent

Before installation, check the compatibility and requirements.

Additional agent package options

Comments

Troubleshooting

The infrastructure agent package includes the additional newrelic-infra-ctl binary, which is used to help troubleshoot a running agent. Although this binary is not required to execute the agent, we recommend that you add it in your path.

Daemon process

As of version 1.5.59, the infrastructure agent package includes the additional newrelic-infra-service binary, which is used to safely manage usual agent daemon process newrelic-infra.

To install the agent:

  1. Download the packaged agent file or use the following command that automatically fetches a specific version of the agent, its checksum and verifies it after download. Replace ARCH=amd64 with desired architecture (amd64, 386, arm64, arm) and V=1.27.4 with latest or specific version.

    bash
    $
    V=1.27.4 ARCH=amd64; echo "https://download.newrelic.com/infrastructure_agent/binaries/linux/${ARCH}/newrelic-infra_linux_${V}_${ARCH}.tar.gz" | { read url; wget "${url}"{,.sum}; shasum -a 256 --check ${url##*/}.sum; }

    From version 1.27.4 on, we provide the tar.gz package GPG signature. You can check the signature procedure and instructions for verification in the infra-agent repository on GitHub.

  2. Unpack the file.

  3. Make sure the file unpacks with the following structure:

    newrelic-infra
    |-- config_defaults.sh
    |-- etc
    | |-- init_scripts
    | | |-- systemd
    | | | `-- newrelic-infra.service
    | | |-- sysv
    | | | `-- newrelic-infra
    | | `-- upstart
    | | `-- newrelic-infra
    | `-- newrelic-infra
    | `-- integrations.d
    |-- installer.sh
    |-- usr
    | `-- bin
    | |-- newrelic-infra
    | |-- newrelic-infra-ctl
    | `-- newrelic-infra-service
    `-- var
    |-- db
    | `-- newrelic-infra
    | |-- custom-integrations
    | |-- integrations.d
    | |-- LICENSE.txt
    | `-- newrelic-integrations
    |-- log
    | `-- newrelic-infra
    `-- run
    `-- newrelic-infra
  4. Install the service script.

  5. Optional: Additional install steps.

Install: Optional steps

You can also carry out these additional steps:

Did this doc help with your installation?

Install the service script

Before you proceed to install the service script, you need to determine which service manager your system is using:

  • If you use one of the supported service managers (SystemD, SysV, and Upstart), use the service script provided in the tarball.
  • If you use a service manager we do not support, you must write your own service script.

Important

In case of doubt, check your Linux distribution's official documentation.

Important

Before copying the service manager script, check if you need to change the user, the path of the agent’s binary, or the pid file location. All these changes need to be reflected in the service script.

If you use one of the supported service managers, install the service script for your host:

Your service script is configured. Configure the rest of the options and start the service manually.

Change config file's location

The infrastructure agent includes a configuration file, usually named newrelic-infra.yml, to fine-tune the agent's behavior. For more information, see a config file template and how to configure the agent.

By default, the agent searches for the configuration file in one of these locations:

  • newrelic-infra.yml (working directory root folder)
  • /etc/newrelic-infra.yml
  • /etc/newrelic-infra/newrelic-infra.yml

To specify a different location, use the -config flag command-line. For example:

bash
$
usr/bin/newrelic-infra -config /whatever/path/custom_config_name.yml

To make this change permanent, edit the service script:

Change the pid-file location

The infrastructure agent uses a pid-file to keep the process identification number (pid), which is used to identify a running instance of the agent. How to change the location of the pid-file depends on how the agent is configured.

Important

By default, we recommend that the agent creates the pid-file. You can edit the location if necessary.

To change the location of the pid-file:

Change the user and runtime mode

The Linux agent runs as root by default, but it also supports running with users with less privileges: PRIVILEGED and UNPRIVILEGED. For more information, see our documentation on agent running modes.

Important

To execute the agent as a non-root user (PRIVILEGED or UNPRIVILEGED), make sure to grant read/write access to the folders and files provided in the tarball.

To change the running mode:

  1. Edit the service script:

  2. If you're running the agent as PRIVILEGED, you must give it two additional Linux capabilities:

    1. Make sure the libcap library is installed in your host. (You need the setcap and getcap commands that come with it.)

    2. Extract the contents of the tarball and execute the following command with root permission:

      bash
      $
      setcap CAP_SYS_PTRACE,CAP_DAC_READ_SEARCH=+ep ./newrelic-infra/usr/bin/newrelic-infra
    3. The run mode will be selected based on the current user and the Kernel Capabilities assigned to it.

Configure the plugin directory

The infrastructure agent allows you to install integrations that monitor and report data from popular services such as Kubernetes, AWS, MySQL, Redis, Kafka, etc. Each integration has its own configuration file, named by default integration-name-config.yml, placed in the predefined location /etc/newrelic-infra/integrations.d/. On initialization, the agent loads the config file.

To overwrite the predefined location of the integration configuration file, use one of the following methods:

  • Set the location in the NRIA_PLUGIN_DIR environment variable.
  • Set the custom path in the newrelic-infra.yml configuration file using the plugin_dir field.
  • Pass it as a command line argument using -plugin_dir when you run the newrelic-infra binary.

Configure the agent directory

The agent requires its own defined directory to run the installed integrations, caching data (inventory), etc. The default location is /var/db/newrelic-infra/.

The agent directory has the following structure and content:

  • LICENSE: Text file containing the New Relic infrastructure agent license.
  • custom-integrations: Directory that stores the installed the custom integrations.
  • newrelic-integrations: Directory that stores the New Relic official integrations.
  • data: Directory where the agent stores cache data (inventory).

Important

The user running the agent must have read/write permissions to the agent directory.

To overwrite the predefined location of the agent directory, use one of the following methods:

  • Set the location in the NRIA_AGENT_DIR environment variable.
  • Set the custom path in the newrelic-infra.yml configuration file using the agent_dir field.
  • Pass it as a command line argument using -agent_dir when you run the newrelic-infra binary.

Configure the log file

By default the agent stores the log files in /var/db/newrelic-infra/newrelic-infra.log.

Important

The user running the agent must have write permissions on the log file.

To overwrite the predefined location of the log file, use one of the following methods:

  • Set the location in the NRIA_LOG_FILE environment variable.
  • Set the custom path in the newrelic-infra.yml configuration file using the log_file field.
  • Pass it as a command line argument using -log_file when you run the newrelic-infra binary.

Change the location of the agent binary

To change the location of the executable, edit the service script:

What's next?

You may also want to:

Copyright © 2024 New Relic Inc.

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