In this article, we will see how to install new relic cli on Linux using 5 easy steps. New Relic CLI is used to manage entity tags, define workloads, record deployment markers, and accomplish many such tasks. It enables the integration of New Relic into your existing workflows. It can fetch the data from your system while doing any troubleshooting tasks as well as can add New Relic into your CI/CD Pipeline.
New Relic CLI provides the best way to manage some of the tools provided by New Relic. There are multiple ways to install New Relic CLI on Linux, Windows and Mac. Here we will see the best way to install New Relic CLI on Linux using few simple steps.
How to Install New Relic CLI on Linux Using 5 Easy Steps
Also Read: How to Install New Relic Infrastructure Agent on Ubuntu 20.04 LTS
Step 1: Prerequisites
a) You should have a running Linux
Server.
b) You should have sudo
or root
access to run privileged commands.
c) You should have curl
utility installed in your Server.
d) You should have a package manager available in your System.
Step 2: Update Your Server
Before installing new relic cli in your system, you have to run the update and install all the latest available package versions from default repo. If you are using Ubuntu/Debian based servers, then you have to run sudo apt update && sudo apt upgrade
command as shown below.
cyberithub@ubuntu:~$ sudo apt update && sudo apt upgrade
If you are using RHEL/CentOS based systems then have to run either sudo yum update && sudo yum upgrade
command or sudo dnf update && sudo dnf
upgrade command.
sudo yum update && sudo yum upgrade sudo dnf update && sudo dnf upgrade
Step 3: Login to New Relic
You have to first login to your New Relic account with your valid id as you can see below. Then click on Next
.
You have to enter your account password to authenticate and continue. Click on Log In
. You also have the option to login through GitHub, GitLab, Bitbucket and Google account.
Step 4: Install New Relic CLI
After successful login, you have to select linux
platform to install new relic cli. You will get the command accordingly upon continuing, which you need to copy and paste in your system terminal as shown below. Then enter to start with the installation. You will be asked few queries during installation, please answer and proceed with the installation just like as shown below.
cyberithub@ubuntu:~$ curl -Ls https://download.newrelic.com/install/newrelic-cli/scripts/install.sh | bash && sudo NEW_RELIC_API_KEY=NRAK-22CH6APFII89X4WDS233D2ATGVU NEW_RELIC_ACCOUNT_ID=4125270 /usr/local/bin/newrelic install Installing New Relic CLI v0.71.0 Installing to /usr/local/bin using sudo _ _ ____ _ _ | | | _____ __ | _ ___| (_) ___ | | |/ _ // / | |_) / _ | | |/ __| | | | __/ V V / | _ | __| | | (__ |_| _|___| _/_/ |_| ____|_|_|___| Welcome to New Relic. Let's set up full stack observability for your environment. Our Data Privacy Notice: https://newrelic.com/termsandconditions/services-notices ✔ Connecting to New Relic Platform Connected Installing New Relic ==> Installing Infrastructure Agent Detecting available SSL ciphers... - SSLv3 - TLSv1 - TLSv1.2 - TLSv1.3 Hit:1 http://ppa.launchpad.net/flatpak/stable/ubuntu focal InRelease Hit:2 http://in.archive.ubuntu.com/ubuntu focal InRelease Get:3 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB] Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB] Hit:5 http://ppa.launchpad.net/gencfsm/ppa/ubuntu focal InRelease Hit:6 http://ppa.launchpad.net/juju/stable/ubuntu focal InRelease Hit:7 http://ppa.launchpad.net/libreoffice/ppa/ubuntu focal InRelease Hit:8 https://download.newrelic.com/infrastructure_agent/linux/apt focal InRelease Hit:9 https://dl.winehq.org/wine-builds/ubuntu focal InRelease Hit:10 https://d3nt0h4h6pmmc4.cloudfront.net/ubuntu focal InRelease Hit:11 http://ppa.launchpad.net/mojo-maintainers/ppa/ubuntu focal InRelease Get:12 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB] Hit:13 https://dl.google.com/linux/chrome/deb stable InRelease Hit:14 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal InRelease Hit:15 https://download.sublimetext.com apt/stable/ InRelease Hit:16 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 InRelease Hit:17 https://ngrok-agent.s3.amazonaws.com buster InRelease Get:18 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [59.9 kB] Get:19 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [96.2 kB] Get:20 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 DEP-11 Metadata [940 B] Get:21 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [275 kB] Get:22 http://in.archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [410 kB] Get:23 http://in.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [944 B] Get:24 http://in.archive.ubuntu.com/ubuntu focal-backports/main amd64 DEP-11 Metadata [7,968 B] Get:25 http://in.archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [30.6 kB] Fetched 1,217 kB in 13s (93.4 kB/s) Reading package lists... Warning: apt-key output should not be parsed (stdout is not a terminal) OK Hit:1 https://download.newrelic.com/infrastructure_agent/linux/apt focal InRelease Hit:2 https://d3nt0h4h6pmmc4.cloudfront.net/ubuntu focal InRelease Hit:3 https://dl.winehq.org/wine-builds/ubuntu focal InRelease Hit:4 https://dl.google.com/linux/chrome/deb stable InRelease Get:5 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB] Hit:6 http://ppa.launchpad.net/flatpak/stable/ubuntu focal InRelease Hit:7 http://in.archive.ubuntu.com/ubuntu focal InRelease Hit:8 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease Hit:9 http://ppa.launchpad.net/gencfsm/ppa/ubuntu focal InRelease Hit:10 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease Hit:11 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 InRelease Hit:12 https://download.sublimetext.com apt/stable/ InRelease Hit:13 http://ppa.launchpad.net/juju/stable/ubuntu focal InRelease Hit:14 https://ngrok-agent.s3.amazonaws.com buster InRelease Hit:15 http://ppa.launchpad.net/libreoffice/ppa/ubuntu focal InRelease Hit:16 http://ppa.launchpad.net/mojo-maintainers/ppa/ubuntu focal InRelease Hit:17 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal InRelease Fetched 114 kB in 4s (25.7 kB/s) Reading package lists... Running agent status check attempt... Agent status check ok. Infra key: ubuntu ✔ Installing Infrastructure Agent Installed ==> Installing Logs Integration ✔ Installing Logs Integration Installed We've detected additional monitoring that can be configured by installing the following: Golden Signal Alerts Apache Integration PostgreSQL Integration ? Continue installing? Yes ==> Installing Golden Signal Alerts Creating alert policy Golden Signals... done File deleted successfully File '/tmp/condition.json' is created Adding alert condition High CPU... done Adding alert condition High Application Error percentage... done Adding alert condition High Application Response Time... done Adding alert condition Low Application Throughput... done Would you like to be notified on your registered email address admin@cyberithub.com when this alert triggers Y/N (default: N)? ✔ Installing Golden Signal Alerts Installed ==> Installing Apache Integration Hit:1 https://d3nt0h4h6pmmc4.cloudfront.net/ubuntu focal InRelease Hit:2 https://download.newrelic.com/infrastructure_agent/linux/apt focal InRelease Hit:3 https://dl.winehq.org/wine-builds/ubuntu focal InRelease Hit:4 http://in.archive.ubuntu.com/ubuntu focal InRelease Get:5 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB] Hit:6 http://ppa.launchpad.net/flatpak/stable/ubuntu focal InRelease Hit:7 https://dl.google.com/linux/chrome/deb stable InRelease Get:8 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB] Hit:9 http://ppa.launchpad.net/gencfsm/ppa/ubuntu focal InRelease Hit:10 https://download.sublimetext.com apt/stable/ InRelease Hit:11 http://ppa.launchpad.net/juju/stable/ubuntu focal InRelease Get:12 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB] Hit:13 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 InRelease Hit:14 https://ngrok-agent.s3.amazonaws.com buster InRelease Hit:15 http://ppa.launchpad.net/libreoffice/ppa/ubuntu focal InRelease Hit:16 http://ppa.launchpad.net/mojo-maintainers/ppa/ubuntu focal InRelease Hit:17 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal InRelease Fetched 336 kB in 7s (47.8 kB/s) Reading package lists... Reading package lists... Building dependency tree... Reading state information... The following NEW packages will be installed: nri-apache 0 upgraded, 1 newly installed, 0 to remove and 25 not upgraded. Need to get 2,358 kB of archives. After this operation, 5,365 kB of additional disk space will be used. Get:1 https://download.newrelic.com/infrastructure_agent/linux/apt focal/main amd64 nri-apache amd64 1.11.0 [2,358 kB] Fetched 2,358 kB in 1s (1,835 kB/s) Selecting previously unselected package nri-apache. (Reading database ... 255170 files and directories currently installed.) Preparing to unpack .../nri-apache_1.11.0_amd64.deb ... Unpacking nri-apache (1.11.0) ... Setting up nri-apache (1.11.0) ... ✔ Installing Apache Integration Installed ==> Installing PostgreSQL Integration Hit:1 https://download.newrelic.com/infrastructure_agent/linux/apt focal InRelease Hit:2 https://d3nt0h4h6pmmc4.cloudfront.net/ubuntu focal InRelease Hit:3 https://dl.winehq.org/wine-builds/ubuntu focal InRelease Hit:4 https://dl.google.com/linux/chrome/deb stable InRelease Hit:5 http://ppa.launchpad.net/flatpak/stable/ubuntu focal InRelease Get:6 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB] Hit:7 http://in.archive.ubuntu.com/ubuntu focal InRelease Hit:8 http://ppa.launchpad.net/gencfsm/ppa/ubuntu focal InRelease Hit:9 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease Hit:10 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 InRelease Hit:11 https://download.sublimetext.com apt/stable/ InRelease Hit:12 http://ppa.launchpad.net/juju/stable/ubuntu focal InRelease Get:13 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB] Hit:14 https://ngrok-agent.s3.amazonaws.com buster InRelease Hit:15 http://ppa.launchpad.net/libreoffice/ppa/ubuntu focal InRelease Hit:16 http://ppa.launchpad.net/mojo-maintainers/ppa/ubuntu focal InRelease Hit:17 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal InRelease Fetched 222 kB in 4s (54.0 kB/s) Reading package lists... [OK] All checks passed. Installing Postgres Integration... Reading package lists... Building dependency tree... Reading state information... The following NEW packages will be installed: nri-postgresql 0 upgraded, 1 newly installed, 0 to remove and 25 not upgraded. Need to get 2,452 kB of archives. After this operation, 5,704 kB of additional disk space will be used. Get:1 https://download.newrelic.com/infrastructure_agent/linux/apt focal/main amd64 nri-postgresql amd64 2.12.2 [2,452 kB] Fetched 2,452 kB in 3s (841 kB/s) Selecting previously unselected package nri-postgresql. (Reading database ... 255178 files and directories currently installed.) Preparing to unpack .../nri-postgresql_2.12.2_amd64.deb ... Unpacking nri-postgresql (2.12.2) ... Setting up nri-postgresql (2.12.2) ... ✔ Installing PostgreSQL Integration Installed New Relic installation complete -------------------- Installation Summary ✔ Golden Signal Alerts (installed) ✔ Apache Integration (installed) ✔ Infrastructure Agent (installed) ✔ Logs Integration (installed) ✔ PostgreSQL Integration (installed) View your data at the link below: ⮕ https://onenr.io/0lY5aqGWkwt View your logs at the link below: ⮕ https://onenr.io/0HWPVpJ8xwF --------------------
Step 5: Go to Dashboard
After successful installation, you can go back to your Dashboard and may notice that New Relic is now able to autodetect the host as shown below.
You can check all the logs of the host system from Logs
-> All logs
as shown below.
You can also check all the entities from All entities
section as shown below.
Discover more from Ubuntu-Server.com
Subscribe to get the latest posts sent to your email.