How to Monitor Nginx using Netdata on CentOS 7

Prerequisites

  1. You must have an Alibaba Cloud Elastic Compute Service (ECS) instance activated and have verified your valid payment method. If you are a new user, you can get a free account in your Alibaba Cloud account. If you don’t know about how to setup your ECS instance, you can refer to this tutorial or quick-start guide. Your ECS instance must have at least 1GB RAM and 1 Core processor.
  2. A domain name registered from Alibaba Cloud. If you have already registered a domain from Alibaba Cloud or any other host, you can update its domain nameserver records.

Install Nginx Web server

yum -y install epel-release
yum -y install nginx
systemctl start nginx
systemctl enable nginx
firewall-cmd --add-service=http --permanent
firewall-cmd --add-service=https --permanent
firewall-cmd --reload
yum -y install firewalld

Enable Nginx Module

cd /etc/nginx/
nano nginx.conf
yum -y install nano
location /stub_status {  
stub_status;
# Security: Only allow access from the IP below.
allow 127.0.0.1;
# Deny anyone else
deny all;
}
nginx -t
systemctl restart nginx

Install Netdata

yum -y install zlib-devel libuuid-devel libmnl-devel gcc make git autoconf autogen automake pkgconfig curl jq nodejs
cd ~
git clone https://github.com/firehol/netdata.git --depth=1
cd netdata/
sudo ./netdata-installer.sh
sudo firewall-cmd --permanent --add-port=19999/tcp
sudo firewall-cmd --reload
systemctl restart netdata
systemctl enable netdata
netstat -plntu

Monitor Nginx using Netdata

cd /etc/netdata/python.d/
nginx.conf
localhost:  
name : 'local'
url : 'http://localhost/stub_status'
systemctl restart netdata

Testing

http://YourServerIPAddress:19999

--

--

--

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Basic Guide to Design a Better Database Schema

Inclavare: Confidential Computing Container Technology for Cloud-Native

New Horizons of the MaxCompute Ecosystem: Rich, Connected, and Integrated

The New Architecture of Search Engines: Stories with SQL

Deploy Django Application on Alibaba Cloud

How to Automate Windows Updates Using PowerShell: Short Overview

Continuous delivery with Flux

SpotOn’s Big Series D Just Might Test A Major Dynamic

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

More from Medium

Containerized Automation

SAML Bearer Grant with WSO2 API Manager & Identity Server

Setting Up a Load Balancer With HAProxy

Analysis of different cloud based MongoDB solutions