How to monitor NGINX with Amplify on Linux

Amplify application helps in the visualization and determination of NGINX web servers and problems associated with their performance, overloaded servers, or potential Denial of Service Attacks (DDoS).

NGINX amplify is a tool that monitors performance, enables real-time examination and helps to fix problems linked with running and scaling of websites, and tracking of systems running within the NGINX.

The NGINX Amplify Agent is written in Python and works with Python 2.6 and 2.7. It doesn’t work with Python 3.0 as of today. Here is the list of supported Linux distributions:

  • Ubuntu
  • Debian
  • RHEL/CentOS/OEL 6
  • RHEL/CentOS/OEL 7
  • Amazon Linux 2017.09

The application helps in the visualization and determination of NGINX web servers and problems associated with their performance, overloaded servers, or potential Denial of Service Attacks (DDoS). NGINX application helps in the optimization of the server’s performance recommending solutions as necessary.

Other glorious functions of the NGINX reporting tool are sending an alert when something is wrong with any of the setup applications and serves as a web capacity and performance planner. Generally, the NGINX amplify structure have the following three components:

1. The Amplify Backend

It is a core component that implements as Software as a Service (SaaS). Its work is to incorporate scalable metrics, a database, core Application Programmers Interface (API), analytical engine, and an analytics engine.

2. The Amplify Agent

This Python application needs installation and runs on monitored systems. The ongoing communication between the agent and SaaS backend are over SSL/TLS where the agent automatically initiates all the traffic.

3. The Amplify Web User Interface (UI)

It is a user interface that supports all other browsers and is accessible via TLS or SSL tunnels.
You can introduce a user-defined dashboard by offering a statistic analyzer to improve the reporting ability of the NGINX.

Installing Amplify Agent on Linux

The first step in installing the Amplify agent is to sign up and create an account.  You will after that get an email with a verification link. Click on that link and log into your account. Follow the instructions as shown

instructions to set up amplify

Download the NGINX install script and use curl or wget command.

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

OR

# curl -L -O https://github.com/nginxinc/nginx-amplify-agent/raw/master/packages/install.sh

Run the command using the sudo command to initiate the API_KEY, which is unique and different for every machine introduced into the system.

# API_KEY='bf7dfaa516e060f9b3b1fe527d48466d' sh ./install.sh

Note that there may be an error indicating that sub_status is not configured. (This process should complete in the next installation phase).
Once you are done, go to the web’s user interface, and wait for at least a minute and you will see the new system on the left side of the screen.

Configure the stub_status in NGINX

Open the stub_status to build NGINX graphs. For NGINX plus users, they need to configure the stub_status or the extended_status module. A new configuration file is created using the command line as shown below

# sudo vi /etc/nginx/conf.d/sub_status.conf

Then copy the following stub_status configuration file inside the fileserver

 {
listen 127.0.0.1:80;
server_name 127.0.0.1;
location /nginx_status {
stub_status;
allow 127.0.0.1;
deny all;
}
}

Save and close the file.

Restart the NGINX server services to make the stub_status

# sudo systemctl restart nginx

Configure Additional NGINX Metrics for Metrics

The next thing to do is to set up additional NGINX metrics to help in monitoring performances. Head out to

etc/nginx/nginx.conf

Add the following code

log_format main_ext '$remote_addr - $remote_user [$time_local] "$request" '
                                '$status $body_bytes_sent "$http_referer" '
                                '"$http_user_agent" "$http_x_forwarded_for" '
                                '"$host" sn="$server_name" ' 'rt=$request_time '
                                'ua="$upstream_addr" us="$upstream_status" '
                                'ut="$upstream_response_time" ul="$upstream_response_length" '
                                'cs=$upstream_cache_status' ;

Next, edit the access_log and error_log to be as follows

access_log /var/log/nginx/suasell.com/suasell.com_access_log main_ext;
error_log /var/log/nginx/suasell.com/suasell.com_error_log warn;

Restart NGINX services for the changes to take place

# sudo systemctl restart nginx

Start the Monitoring Process Via Amplify Agent

Finally, you can start monitoring your Nginx web server. Head out to your browser on the Amplify page and click on overview as shown.

Overview

Nginx amplify overview

To get more detailed statistics, click on the ‘Graphs” tab

Nginx-amplify graphs

That’s all we had for today. Feel free to try out the tool!

James Kiarie
Hey! This is James, a tech enthusiast, and a certified Linux professional. I derive immense gratification in learning more about FOSS technologies more keeping tabs on the latest tools and features in several Linux distributions. Away from Linux, I love swimming, hiking and playing video games.

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

23,661FansLike
359FollowersFollow
16SubscribersSubscribe

LATEST ARTICLES

How to install Lightworks on Ubuntu

Even though Linux may not get a native installer of video editing software like Adobe Premiere or Final Cut Pro, that doesn't mean there are no industry standards tools available. Lightworks is non-linear editing (NLE) video mastering app for Windows, Linux, and macOS. Installing it on Ubuntu is simple due to deb package availability.

How to install DaVinci Resolve on Fedora

Davinci Resolve is a professional application used for color correction, video editing, visual effects, and motion graphics. It is one of the extensively used software by movie industries located in Hollywood.

The 10 Best Programming Languages for Hacking

One of the significant entities we have in Cyber Security is Ethical Hacking (ETH). It is the process of detecting and finding flaws or vulnerabilities in a system that a hacker would exploit.

5 Ways to Open a Terminal in Ubuntu

Even though Ubuntu supports many applications with amazing Graphical User Interfaces (GUI), there are always reasons why users prefer using the Terminal to perform different tasks.

How to install Wine on Fedora Workstation

Linux distributions are becoming more and more popular every day, and Fedora Workstation is not left behind. This popularity brings forth the need to run Windows applications on Linux distros like Fedora. Windows has quite some excellent Software that is not available for Linux.

How to download and install iTunes on Linux

iTunes has always been a convenient platform for downloading, organizing, playing, and syncing media between your Apple devices. It also gives users a large pool of media to buy or stream millions of songs using Apple Music.

MUST READ

Linux is growing faster than ever. As per the latest report, there is a drop in the Windows 10 market share for the first time, and Linux's market share has improved to 2.87% this month. Most of the features in the list were rolled out in the Pop OS 20.04. Let's a detailed look into the new features, how to upgrade, and a ride through video.
Elementary OS 5.1 Hera has received a point release with a handful of new features and bug fixes, and we will be reviewing the significant changes in this article. For those new to elementary OS, this Ubuntu-based Linux distribution uses their inhouse built Pantheon desktop environment and AppCenter.

5 Best Download Managers for Linux

We often need to download large files that can go corrupt due to various reasons such as slow internet or interrupted download. Using a broken downloaded file is not something one wants. Download managers make sure that the downloaded file maintains its integrity and also presents you with the ability to pause and resume downloads, provided the server supports it. When you are downloading a massive file, it's recommended to use a download manager.

5 Things to do when your Linux system GUI freezes

All operating systems freeze at some point and, Linux distributions are no exceptions. In this post, we are going to look at five methods you can apply to your frozen system before thinking of plugging out the power cable or holding down the power button to power off the PC.

7 Best Ways to Kill Unresponsive Programs in Linux

For dealing with a frozen app or desktop, you can't use the CTRL+ALT+DEL in Linux system. Instead, there are powerful alternatives that come in handy in frustrating situations. We pick the best methods available for you.

VIDEO: Linux Lite 4.8 Features and Desktop Tour

Linux Lite eases Windows 7 users transition to Linux much more comfortable by offering simple software like Team Viewer, VLC, Firefox, TimeShift backup utility, and a full Microsoft Office compatible office suite in LibreOffice.