In this post, I will tell you how to install New Relic Infrastructure on Linux.
New Relic Infrastructure is a flexible and dynamic monitoring tool that can keep track of your entire infrastructure. Surveillance of cloud services, or the dedicated resources, or the containers running in an orchestrated environment is possible with the New Relic Infrastructure.
You can monitor all the host data on one page due to the modern UI of the infrastructure. The real-time data collection accelerates the function of modern operations teams.
Moreover, you can create custom queries to get a better understanding of your data. All the custom charts, tables and other visual presentation of data helps make the New Relic Infrastructure a powerful monitoring tool.
In this post, we will be looking at how to install and configure New Relic Infrastructure on your server.
Compatibility and requirements for New Relic Infrastructure
Ensure your system is compatible before installing the New Relic Infrastructure.
Processor architectures
New Relic Infrastructure supports only x86 processors.
- Linux: 64-bit architecture
- Windows: 32-bit and 64-bit architecture
ARM processors are not supported.
Operating systems
Unique hostname
The hostname of each server must be unique to avoid the inaccurate metrics.
When there are few servers combined in a single hostname, you have to make sure that each server has a separate name.
Use the optional “display_name” setting to override the default hostnames.
Permissions
To install the infrastructure, you have to give permissions:
Linux: The agents run ad install as root. However, you have the option to choose privileged or unprivileged run modes.
Windows: The agent must be installed from the administrator account, and it requires admin privileges to run.
Network access
Infrastructure has to have access to certain domains and ports in order to report data to New Relic.
Container software
Infrastructure supports Docker versions 1.12 or higher.
CPU, memory, and disk usage
There load depends on the host’s workload, specifically on the number of processes running on the host. Basically, the infrastructure collects event data from each individual process, hence, if there are more process, then there is more data to collect.
However, there are benchmarks for most common type of hosts. You can read in detail here.
Integrations
New Relic Infrastructure include integrations for:
- Amazon Web Services (AWS)
- Google Cloud Platform (GCP)
- Microsoft Azure
- Kubernetes
- Popular services like Apache, StatsD, NGINX, Redis, and many more
- Prometheus (not included in compute units (CUs) pricing for Infrastructure Pro)
Supported browsers
New Relic supports the two most recent desktop versions for these browsers:
- Google Chrome: Linux, macOS, Windows
- Microsoft Edge: Windows
- Mozilla Firefox: Linux, macOS, Windows
- Safari: macOS
Where to find your License Key?
The New Relic license key is a 40-character hexadecimal string that we provide when you sign up for a New Relic account. We use license keys to differentiate your account from others. Every type of account has one (regardless of your subscription).
The license key provided by the New Relic is a 40-character hexadecimal secure string. Each New Relic key is unique, and works as an identifier of the account.
You can view your New Relic key at:
- Sing in into your New Relic account
- Locate the drop-down menu, and open the “Account Settings”.
- Navigate to the Account information setting on the right side of the summary page.
- Copy the License key from there
- Use the key during the installation and updates
How to Install New Relic Infrastructure?
Step 1: Add the license key to newrelic-infra.yml file.
echo "license_key: <LICENSE_KEY>" >> /etc/newrelic-infra.yml
Step 2: Add the repository for newrelic.
Note: The command varies depending on the OS Distribution and releases version. The repo download link can be found here:
https://download.newrelic.com/infrastructure_agent/linux/
Step 3: Install newrelic-Infra package
For Ubuntu:
apt-get install newrelic-infra -y
For Centos:
yum install newrelic-infra -y
Note: By default, newrelic runs as root user which gives it all the privileges to read the log files and integrations.
Step 4: Start the service.
systemctl newrelic-infra start
/etc/init.d/newrelic-infra start
initctl start newrelic-infra
service newrelic-infra start
Step 5: Test log forwarding function
Infrastructure is successfully installed and running. We have to test the log forwarding functionality now.
To do this, simply create a yml file in /etc/newrelic-infra/logging.d/ and add the below code:
logs:
- name: "Testing log forwarding from ServerGuy"
file: /var/log/test.log
Note: Since it is a YAML file, make sure to use spaces for intending.
Now, echo any string to the log file path you provided. In the above case, it is /var/log/test.log
echo "Testing Log Forwarding from ServerGuy" >> /var/log/test.log
Login to the New Relic Dashboard to check if the logs have been forwarded.
Now after yo install New Relic Infrastructure on Linux, you can integrate it with the Nginx.
Integrating Nginx to New Relic Infrastructure
Once the log forwarding is confirmed, we can proceed to integrate newrelic-infra with the services.
Note: All the integrations are separate packages installed using the default package manager.
For Nginx, install the integration nri-nginx.
yum install nri-nginx -y
First, we need to make sure that the Nginx module “http_stub_status_module” is enabled on the server.
Simply execute the below command and check the output.
nginx -V 2>&1 | grep --color "with-http_stub_status_module"
Note: All the integrations will have a configurable YAML file in /etc/newrelic-infra/integrations.d/
To configure the integration, we need to edit the Nginx conf file and add the below entry to the VirtualHost within the server block.
location = /basic_status {
stub_status;
}
Make sure that a status page as shown in the screenshot below appears when calling the server’s $HOSTNAME/basic_status or $IP/basic_status.
Edit the integration’s config file in /etc/newrelic-infra/integrations.d/nginx-config.yml
Update the value from:
status_url: http://127.0.0.1/status
To:
status_url: http://{{SERVER_IP/HOSTNAME}}/basic_status
Login to infrastructure.newrelic.com and go to
Infrastructure -> Third-party Services -> Nginx
to test the configurations.
How much does the New Relic cost?
There are two plans for New Relic. The cost of Essential New Relic starts from $7.2 per month. This is for the organization that only requires the essential features, without any integration.
The pro plan costs $14.4 per month. This is for large organizations that need advanced monitoring and integrations.
Wrap Up
Hope this article helped you, and you can install New Relic Infrastructure on Linux without any issue.
However, if any problem arise, leave it in the comment box.