Home Downloads How to monitor NGINX with Amplify on Linux

How to monitor NGINX with Amplify on Linux

by James Kiarie
Published: Last Updated on
monitor nginx with amplify

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!

You may also like

1 comment

Eric Stalee December 2, 2019 - 10:57 PM

FYI, a better fork of this client exists at https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md

Reply

Leave a Reply to Eric Stalee Cancel Reply

fl_logo_v3_footer

ENHANCE YOUR LINUX EXPERIENCE.



FOSS Linux is a leading resource for Linux enthusiasts and professionals alike. With a focus on providing the best Linux tutorials, open-source apps, news, and reviews written by team of expert authors. FOSS Linux is the go-to source for all things Linux.

Whether you’re a beginner or an experienced user, FOSS Linux has something for everyone.

Follow Us

Subscribe

©2016-2023 FOSS LINUX

A PART OF VIBRANT LEAF MEDIA COMPANY.

ALL RIGHTS RESERVED.

“Linux” is the registered trademark by Linus Torvalds in the U.S. and other countries.