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 |
Daemon process | As of version 1.5.59, the infrastructure agent package includes the additional |
To install the agent:
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) andV=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 thetar.gz
package GPG signature. You can check the signature procedure and instructions for verification in the infra-agent repository on GitHub.Unpack the file.
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-infraOptional: Additional install steps.
Install: Optional steps
You can also carry out these additional steps:
- Change the location of the configuration file.
- Change the location of the PID file.
- Change the user and runtime mode.
- Configure the plugin directory.
- Configure the agent directory.
- Configure the log file.
- Change the location of the agent binary.
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:
$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:
Edit the service script:
If you're running the agent as
PRIVILEGED
, you must give it two additional Linux capabilities:Make sure the
libcap
library is installed in your host. (You need thesetcap
andgetcap
commands that come with it.)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-infraThe 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 theplugin_dir
field. - Pass it as a command line argument using
-plugin_dir
when you run thenewrelic-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 theagent_dir
field. - Pass it as a command line argument using
-agent_dir
when you run thenewrelic-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 thelog_file
field. - Pass it as a command line argument using
-log_file
when you run thenewrelic-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:
- Add custom attributes to annotate your infrastructure data.
- Connect your AWS account if your servers are hosted on Amazon EC2.
- Enable log forwarding.
- Enable our Flex integration by manually adding the Flex executable.
- Add other infrastructure integrations to collect data from external services.
- Manually start, stop, restart, or check the agent status.