Networking

How to set up web-based monitoring with NGINX Amplify

NGINX now offers a powerful web-based monitoring system, called Amplify. Here's how to get it up and running quickly.

amplifyhero.jpg
Image: Jack Wallen

You may not have heard that the NGINX developers were working on a powerful monitoring platform, called NGINX Amplify. If not, know that Amplify is all about making NGINX monitoring both powerful and easy. When I say the developers have succeeded in creating something every NGINX admin will want, that should be considered an understatement. Even this early in the game, Amplify offers the following features:

  • Overview and SLA gives a 30‑second checkup of NGINX health.
  • A standard set of graphs for NGINX, PHP‑FPM, and OS metrics.
  • An overview of your NGINX configuration file, with alerts about common configuration problems.
  • A easy to manage dashboard where you can create your own graphs.
  • Notifications about abnormal NGINX behavior.
  • A listing of all monitored systems.

What's best is that Amplify has been made incredibly easy to install. You can use NGINX Amplify for free on up to 5 servers. There is no trial period, so you can monitor those servers, for free, indefinitely. If you attempt to add more than five servers, NGINX Amplify will direct you to the NGINX sales team, so you can work out a pricing model that suits you and your company.

I'll be demonstrating on Ubuntu Server 16.04, but know this will only work on the currently supported platforms:

  • Amazon Linux
  • CentOS
  • Debian
  • Red Hat Linux
  • Ubuntu

You will also need to have Python version 2.6 or 2.7 (not Python 3).

Before you dive into the instructions, you'll need to head over to amplify.nginx.com and sign up for an account.

With your account set up, let's install.

SEE: SaaS Research 2017: Adoption rates, business benefits, and preferred providers (Tech Pro Research)

Installation

I will assume you already have NGINX installed and running. With that in place, log into your Amplify account and click New System (bottom right corner of the main window). A popup will appear instructing you how to install the Amplify agent. The instructions are quite simple.

Open up a terminal window on your server and download the installer file with the command:

wget https://github.com/nginxinc/nginx-amplify-agent/raw/master/packages/install.sh

When the download completes, change to the root user with the command sudo -s and then issue the following:

API_KEY='KEY' sh ./install.sh

Where KEY is the key you are given in the popup window from the Amplify Dashboard.

Allow this to complete. Once it does, you can open up a browser window and point it to your NGINX Amplify Dashboard and, within minutes, your server will show up for monitoring.

SEE: Special report: The cloud v. data center decision (free PDF) (TechRepublic)

Manual installation

If you have trouble installing via the automated method, here are the steps for manually installing NGINX Amplify on Ubuntu.

Change to the root user with the command:

sudo -s

Add the necessary public key with the command:

wget -q -O - http://nginx.org/keys/nginx_signing.key | apt-key add -

Configure the repository with the command:

codename=`lsb_release -cs` && \
os=`lsb_release -is | tr '[:upper:]' '[:lower:]'` && \
echo "deb http://packages.amplify.nginx.com/${os}/ ${codename} amplify-agent" > \
/etc/apt/sources.list.d/nginx-amplify.list

Update apt with the command:

apt-get update

Install the agent with the command:

apt-get install nginx-amplify-agent

Create the necessary config file with the command:

api_key="KEY" && \
sed "s/api_key.*$/api_key = ${api_key}/" \
/etc/amplify-agent/agent.conf.default > \
/etc/amplify-agent/agent.conf

Where KEY is the API key is the unique key assigned to your NGINX Amplify account.

Start the agent with the command:

service amplify-agent start

Remember, it may take some time for metrics to begin appearing in your Amplify Dashboard (Figure A).

Figure A

Figure A

An NGINX server now showing in the Dashboard.


Correcting a problem

I ran both types of installations—automatic and manual. On one machine, the automatic installation failed (it could not retrieve the necessary key from the Amplify servers). After running the manual installation on that same machine, the Amplify dashboard couldn't retrieve any metrics. To resolve that, I went back and issued the command:

API_KEY='KEY' sh ./install.sh

Where KEY is the unique key from your Amplify dashboard (when clicking New System). That time, the key was already installed and the script ran to completion. After a moment, metrics began to appear in the system that originally had issues.

A must have

If you're an NGINX administrator, Amplify should be considered a must have. With this system you can keep tabs on your web servers, create new dashboards, set up alerts, and so much more. Considering how easy it is to install and how much it offers, you'd be hard-pressed to find a better solution for NGINX web server monitoring.

Also see

About Jack Wallen

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website jackwallen.com.

Editor's Picks

Free Newsletters, In your Inbox