In this tutorial, we will show you how to install Nginx Amplify Agent on Ubuntu 16.04 LTS. For those of you who didn’t know, Nginx Amplify Agent is a Strong Nginx monitoring tool written in Python. Its function is to collect various metrics and metadata and send Them securely into the backend for storage and visualization. After appropriate Installation, it supplies you with the NGINX Amplify web interface and also you Should observe real-time metrics of your monitored systems.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation Nginx Amplify Agent monitoring tool on an Ubuntu 16.04 Xenial Xerus server.
Prerequisites
- A server running one of the following operating systems: Ubuntu 16.04, and any other Debian-based distribution like Linux Mint.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install Nginx Amplify Agent on Ubuntu 16.04 LTS
Step 1. First, make sure that all your system packages are up-to-date by running the following apt-get
commands in the terminal.
sudo apt-get update sudo apt-get upgrade
Step 2. Installing Nginx Amplify Agent on Ubuntu 16.04.
First, add the necessary public key with the command:
curl -fs 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
Install the Nginx Amplify Agent using apt:
apt-get update apt-get install nginx-amplify-agent
Creating the Config File from a Template:
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.
Once installed, These commands can be used to start/stop the agent:
systemctl enable amplify-agent systemctl start amplify-agent
Step 3. Configuring the Nginx Amplify Agent.
Checklist:
- stub status
- extended access logging
- ‘warn’ level on error logging
server { listen [::]:80; server_name bmw.idroot.us localhost [::1] 127.0.0.1; keepalive_timeout 60; location /nginx_status { stub_status; access_log off; allow ::1; allow 127.0.0.1; deny all; } }
The logging needs to be configured to have extended information as per the documentation:
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' ' $status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for" ' 'rt=$request_time ua="$upstream_addr" ' 'us="$upstream_status" ut="$upstream_response_time" ' 'ul="$upstream_response_length" ' 'cs=$upstream_cache_status' ;
Ensure warnings are logged to the error log:
error_log /var/log/nginx/error.log warn
Finally steps, You can overview the status of our monitored server in the Web interface by logging into your Amplify Account as in the snapshot:
Congratulations! You have successfully installed Nginx Amplify Agent. Thanks for using this tutorial for installing the Nginx Amplify Agent monitoring tool on your Ubuntu 16.04 LTS. For additional help or useful information, we recommend you to check the official Nginx Amplify Agent website.