Install NGINX Amplify Agent
To use F5 NGINX Amplify to monitor your infrastructure, you need to install NGINX Amplify Agent on each system you wish to monitor.
Note:
NGINX Amplify Agent will drop root privileges on startup. It will then use the user ID of the usernginx
to set its effective user ID. The package install procedure will add thenginx
user automatically unless it’s already found in the system. If the user directive appears in the NGINX configuration, NGINX Amplify Agent will pick up the user specified in the NGINX config for its effective user ID (e.g.www-data
).
Using the Install Script
Take the following steps to install NGINX Amplify Agent:
-
Download and run the install script.
curl -sS -L -O \ https://github.com/nginxinc/nginx-amplify-agent/raw/master/packages/install.sh && \ API_KEY='YOUR_API_KEY' sh ./install.sh
Where YOUR_API_KEY is a unique API key assigned to your Amplify account. You will see the API key when adding a new system in the Amplify web interface. You can also find it in the Account menu.
-
Verify that NGINX Amplify Agent has started.
ps ax | grep -i 'amplify\-' 2552 ? S 0:00 amplify-agent
Installing NGINX Amplify Agent Manually
Installing on Ubuntu or Debian
-
Add the NGINX public key.
curl -fs http://nginx.org/keys/nginx_signing.key | apt-key add -
or
wget -q -O - \ http://nginx.org/keys/nginx_signing.key | apt-key add -
-
Configure the repository as follows.
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
-
Verify the repository config file (Ubuntu 14.04 example follows).
cat /etc/apt/sources.list.d/nginx-amplify.list deb http://packages.amplify.nginx.com/ubuntu/ trusty amplify-agent
-
Update the package index files.
apt-get update
-
Install and run NGINX Amplify Agent.
apt-get install nginx-amplify-agent
Installing on CentOS, Red Hat Linux, or Amazon Linux
-
Add the NGINX public key.
curl -sS -L -O http://nginx.org/keys/nginx_signing.key && \ rpm --import nginx_signing.key
or
wget -q -O nginx_signing.key http://nginx.org/keys/nginx_signing.key && \ rpm --import nginx_signing.key
-
Create the repository config as follows (mind the correct release number).
Use the first snippet below for CentOS and Red Hat Linux. The second one applies to Amazon Linux.
release="7" && \ printf "[nginx-amplify]\nname=nginx amplify repo\nbaseurl=http://packages.amplify.nginx.com/centos/${release}/\$basearch\ngpgcheck=1\nenabled=1\n" > \ /etc/yum.repos.d/nginx-amplify.repo
release="latest" && \ printf "[nginx-amplify]\nname=nginx amplify repo\nbaseurl=http://packages.amplify.nginx.com/amzn/${release}/\$basearch\ngpgcheck=1\nenabled=1\n" > \ /etc/yum.repos.d/nginx-amplify.repo
-
Verify the repository config file (RHEL 7.1 example follows).
cat /etc/yum.repos.d/nginx-amplify.repo [nginx-amplify] name=nginx repo baseurl=http://packages.amplify.nginx.com/centos/7/$basearch gpgcheck=1 enabled=1
-
Update the package metadata.
yum makecache
-
Install and run NGINX Amplify Agent.
yum install nginx-amplify-agent
Creating the Config File from a Template
api_key="YOUR_API_KEY" && \
sed "s/api_key.*$/api_key = ${api_key}/" \
/etc/amplify-agent/agent.conf.default > \
/etc/amplify-agent/agent.conf
API_KEY is a unique API key assigned to your Amplify account. You will see your API key when adding a new system using the Amplify web interface. You can also find the API key in the Account menu.
Starting and Stopping NGINX Amplify Agent
service amplify-agent start
service amplify-agent stop
service amplify-agent restart
Verifying that NGINX Amplify Agent Has Started
ps ax | grep -i 'amplify\-'
2552 ? S 0:00 amplify-agent