Monitor Performance Of CentOS Server Using Netdata

In this article, we’ll see how to Monitor Performance Of CentOS Server Using Netdata. Netdata is an open-source real-time monitoring Linux server. Netdata collects thousands of metrics from Linux, system, container, application, and hardware.

Netdata supports most of the Linux distribution such as CentOS, Debian, Ubuntu, Alpine Linux, Arch Linux, etc. It also monitors container platforms such as Kubernetes clusters, docker. And other operating systems such as FreeBSD or macOS. Netdata is widely used by DevOps, sysadmin/ system administrators, or developers to collect most of the metric which can be used to visualize or troubleshoot a performance issue.

Steps to Install Netdata in CentOS Linux

Step 1: Update the system and install the EPEL repository

$ sudo yum update

$ sudo yum install epel-release

Monitor Performance Of CentOS Server Using Netdata

Sample Output:

[root@netdata-server ~]# sudo yum install epel-release
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: centos.mirror.snu.edu.in
* extras: centos.mirror.snu.edu.in
* updates: centos.mirror.snu.edu.in
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/3): base/7/x86_64/primary_db | 6.1 MB 00:00:11
(2/3): extras/7/x86_64/primary_db | 236 kB 00:00:16
(3/3): updates/7/x86_64/primary_db | 8.0 MB 00:00:26
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================
Installing:
epel-release noarch 7-11 extras 15 k

Transaction Summary
=============================================================================================================================================================
Install 1 Package

Total download size: 15 k
Installed size: 24 k
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/extras/packages/epel-release-7-11.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY | 0 B --:--:-- ETA
Public key for epel-release-7-11.noarch.rpm is not installed
epel-release-7-11.noarch.rpm | 15 kB 00:00:15
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
Userid : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
Package : centos-release-7-7.1908.0.el7.centos.x86_64 (@anaconda)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : epel-release-7-11.noarch 1/1
Verifying : epel-release-7-11.noarch 1/1

Installed:
epel-release.noarch 0:7-11

Complete!
[root@netdata-server ~]#

Step 2: Install the prerequisite software packages 

$ sudo yum install make curl gcc git zlib-devel git automake libuuid-devel libmnl autoconf pkgconfig findutils

Monitor Performance Of CentOS Server Using Netdata

Sample Output:

[root@netdata-server yum.repos.d]# sudo yum install make curl gcc git zlib-devel git automake libuuid-devel libmnl autoconf pkgconfig findutils
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror-hk.koddos.net
* epel: ftp.iij.ad.jp
* extras: mirror-hk.koddos.net
* updates: mirror-hk.koddos.net
Package 1:make-3.82-24.el7.x86_64 already installed and latest version
Package libmnl-1.0.3-7.el7.x86_64 already installed and latest version
Package 1:pkgconfig-0.27.1-4.el7.x86_64 already installed and latest version
Package 1:findutils-4.5.11-6.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package autoconf.noarch 0:2.69-11.el7 will be installed
--> Processing Dependency: m4 >= 1.4.14 for package: autoconf-2.69-11.el7.noarch
--> Processing Dependency: perl(Data::Dumper) for package: autoconf-2.69-11.el7.noarch
---> Package automake.noarch 0:1.13.4-3.el7 will be installed
--> Processing Dependency: perl(Thread::Queue) for package: automake-1.13.4-3.el7.noarch
--> Processing Dependency: perl(TAP::Parser) for package: automake-1.13.4-3.el7.noarch
---> Package curl.x86_64 0:7.29.0-54.el7 will be updated
---> Package curl.x86_64 0:7.29.0-59.el7_9.1 will be an update
--> Processing Dependency: libcurl = 7.29.0-59.el7_9.1 for package: curl-7.29.0-59.el7_9.1.x86_64
---> Package gcc.x86_64 0:4.8.5-44.el7 will be installed
--> Processing Dependency: libgomp = 4.8.5-44.el7 for package: gcc-4.8.5-44.el7.x86_64
--> Processing Dependency: cpp = 4.8.5-44.el7 for package: gcc-4.8.5-44.el7.x86_64
--> Processing Dependency: libgcc >= 4.8.5-44.el7 for package: gcc-4.8.5-44.el7.x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-44.el7.x86_64
---> Package git.x86_64 0:1.8.3.1-23.el7_8 will be installed
--> Processing Dependency: perl-Git = 1.8.3.1-23.el7_8 for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(Git) for package: git-1.8.3.1-23.el7_8.x86_64
--> Processing Dependency: perl(Error) for package: git-1.8.3.1-23.el7_8.x86_64
---> Package libuuid-devel.x86_64 0:2.23.2-65.el7_9.1 will be installed
--> Processing Dependency: libuuid = 2.23.2-65.el7_9.1 for package: libuuid-devel-2.23.2-65.el7_9.1.x86_64
---> Package zlib-devel.x86_64 0:1.2.7-19.el7_9 will be installed
--> Processing Dependency: zlib = 1.2.7-19.el7_9 for package: zlib-devel-1.2.7-19.el7_9.x86_64
--> Running transaction check
---> Package cpp.x86_64 0:4.8.5-44.el7 will be installed
---> Package glibc-devel.x86_64 0:2.17-324.el7_9 will be installed
--> Processing Dependency: glibc-headers = 2.17-324.el7_9 for package: glibc-devel-2.17-324.el7_9.x86_64
--> Processing Dependency: glibc = 2.17-324.el7_9 for package: glibc-devel-2.17-324.el7_9.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-324.el7_9.x86_64
---> Package libcurl.x86_64 0:7.29.0-54.el7 will be updated
---> Package libcurl.x86_64 0:7.29.0-59.el7_9.1 will be an update
---> Package libgcc.x86_64 0:4.8.5-39.el7 will be updated
---> Package libgcc.x86_64 0:4.8.5-44.el7 will be an update
---> Package libgomp.x86_64 0:4.8.5-39.el7 will be updated
---> Package libgomp.x86_64 0:4.8.5-44.el7 will be an update
---> Package libuuid.x86_64 0:2.23.2-61.el7 will be updated
--> Processing Dependency: libuuid = 2.23.2-61.el7 for package: util-linux-2.23.2-61.el7.x86_64
--> Processing Dependency: libuuid = 2.23.2-61.el7 for package: libblkid-2.23.2-61.el7.x86_64
--> Processing Dependency: libuuid = 2.23.2-61.el7 for package: libmount-2.23.2-61.el7.x86_64
---> Package libuuid.x86_64 0:2.23.2-65.el7_9.1 will be an update
---> Package m4.x86_64 0:1.4.16-10.el7 will be installed
---> Package perl-Data-Dumper.x86_64 0:2.145-3.el7 will be installed
---> Package perl-Error.noarch 1:0.17020-2.el7 will be installed
---> Package perl-Git.noarch 0:1.8.3.1-23.el7_8 will be installed
---> Package perl-TermReadKey.x86_64 0:2.30-20.el7 will be installed
---> Package perl-Test-Harness.noarch 0:3.28-3.el7 will be installed
---> Package perl-Thread-Queue.noarch 0:3.02-2.el7 will be installed
---> Package zlib.x86_64 0:1.2.7-18.el7 will be updated
---> Package zlib.x86_64 0:1.2.7-19.el7_9 will be an update
--> Running transaction check
---> Package glibc.x86_64 0:2.17-292.el7 will be updated
--> Processing Dependency: glibc = 2.17-292.el7 for package: glibc-common-2.17-292.el7.x86_64
---> Package glibc.x86_64 0:2.17-324.el7_9 will be an update
---> Package glibc-headers.x86_64 0:2.17-324.el7_9 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-324.el7_9.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.17-324.el7_9.x86_64
---> Package libblkid.x86_64 0:2.23.2-61.el7 will be updated
---> Package libblkid.x86_64 0:2.23.2-65.el7_9.1 will be an update
---> Package libmount.x86_64 0:2.23.2-61.el7 will be updated
---> Package libmount.x86_64 0:2.23.2-65.el7_9.1 will be an update
---> Package util-linux.x86_64 0:2.23.2-61.el7 will be updated
---> Package util-linux.x86_64 0:2.23.2-65.el7_9.1 will be an update
--> Processing Dependency: libsmartcols = 2.23.2-65.el7_9.1 for package: util-linux-2.23.2-65.el7_9.1.x86_64
--> Running transaction check
---> Package glibc-common.x86_64 0:2.17-292.el7 will be updated
---> Package glibc-common.x86_64 0:2.17-324.el7_9 will be an update
---> Package kernel-headers.x86_64 0:3.10.0-1160.25.1.el7 will be installed
---> Package libsmartcols.x86_64 0:2.23.2-61.el7 will be updated
---> Package libsmartcols.x86_64 0:2.23.2-65.el7_9.1 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================
Installing:
autoconf noarch 2.69-11.el7 base 701 k
automake noarch 1.13.4-3.el7 base 679 k
gcc x86_64 4.8.5-44.el7 base 16 M
git x86_64 1.8.3.1-23.el7_8 base 4.4 M
libuuid-devel x86_64 2.23.2-65.el7_9.1 updates 93 k
zlib-devel x86_64 1.2.7-19.el7_9 updates 50 k
Updating:
curl x86_64 7.29.0-59.el7_9.1 updates 271 k
Installing for dependencies:
cpp x86_64 4.8.5-44.el7 base 5.9 M
glibc-devel x86_64 2.17-324.el7_9 updates 1.1 M
glibc-headers x86_64 2.17-324.el7_9 updates 691 k
kernel-headers x86_64 3.10.0-1160.25.1.el7 updates 9.0 M
m4 x86_64 1.4.16-10.el7 base 256 k
perl-Data-Dumper x86_64 2.145-3.el7 base 47 k
perl-Error noarch 1:0.17020-2.el7 base 32 k
perl-Git noarch 1.8.3.1-23.el7_8 base 56 k
perl-TermReadKey x86_64 2.30-20.el7 base 31 k
perl-Test-Harness noarch 3.28-3.el7 base 302 k
perl-Thread-Queue noarch 3.02-2.el7 base 17 k
Updating for dependencies:
glibc x86_64 2.17-324.el7_9 updates 3.6 M
glibc-common x86_64 2.17-324.el7_9 updates 12 M
libblkid x86_64 2.23.2-65.el7_9.1 updates 183 k
libcurl x86_64 7.29.0-59.el7_9.1 updates 223 k
libgcc x86_64 4.8.5-44.el7 base 103 k
libgomp x86_64 4.8.5-44.el7 base 159 k
libmount x86_64 2.23.2-65.el7_9.1 updates 185 k
libsmartcols x86_64 2.23.2-65.el7_9.1 updates 143 k
libuuid x86_64 2.23.2-65.el7_9.1 updates 84 k
util-linux x86_64 2.23.2-65.el7_9.1 updates 2.0 M
zlib x86_64 1.2.7-19.el7_9 updates 90 k

Transaction Summary
=============================================================================================================================================================
Install 6 Packages (+11 Dependent packages)
Upgrade 1 Package (+11 Dependent packages)

Total download size: 58 M
Is this ok [y/d/N]: y
Downloading packages:
No Presto metadata available for base
No Presto metadata available for updates
(1/29): curl-7.29.0-59.el7_9.1.x86_64.rpm | 271 kB 00:00:06
(2/29): autoconf-2.69-11.el7.noarch.rpm | 701 kB 00:00:07
(3/29): automake-1.13.4-3.el7.noarch.rpm | 679 kB 00:00:08
(4/29): cpp-4.8.5-44.el7.x86_64.rpm | 5.9 MB 00:00:14
(5/29): glibc-2.17-324.el7_9.x86_64.rpm | 3.6 MB 00:00:06
(6/29): glibc-headers-2.17-324.el7_9.x86_64.rpm | 691 kB 00:00:01
(7/29): git-1.8.3.1-23.el7_8.x86_64.rpm | 4.4 MB 00:00:11
(8/29): libblkid-2.23.2-65.el7_9.1.x86_64.rpm | 183 kB 00:00:00
(9/29): glibc-common-2.17-324.el7_9.x86_64.rpm | 12 MB 00:00:13
(10/29): libgcc-4.8.5-44.el7.x86_64.rpm | 103 kB 00:00:00
(11/29): libgomp-4.8.5-44.el7.x86_64.rpm | 159 kB 00:00:00
(12/29): libmount-2.23.2-65.el7_9.1.x86_64.rpm | 185 kB 00:00:00
(13/29): libsmartcols-2.23.2-65.el7_9.1.x86_64.rpm | 143 kB 00:00:00
(14/29): libuuid-2.23.2-65.el7_9.1.x86_64.rpm | 84 kB 00:00:00
(15/29): libuuid-devel-2.23.2-65.el7_9.1.x86_64.rpm | 93 kB 00:00:00
(16/29): m4-1.4.16-10.el7.x86_64.rpm | 256 kB 00:00:00
(17/29): perl-Data-Dumper-2.145-3.el7.x86_64.rpm | 47 kB 00:00:00
(18/29): perl-Error-0.17020-2.el7.noarch.rpm | 32 kB 00:00:00
(19/29): perl-Git-1.8.3.1-23.el7_8.noarch.rpm | 56 kB 00:00:00
(20/29): perl-TermReadKey-2.30-20.el7.x86_64.rpm | 31 kB 00:00:00
(21/29): perl-Test-Harness-3.28-3.el7.noarch.rpm | 302 kB 00:00:00
(22/29): perl-Thread-Queue-3.02-2.el7.noarch.rpm | 17 kB 00:00:00
(23/29): util-linux-2.23.2-65.el7_9.1.x86_64.rpm | 2.0 MB 00:00:01
(24/29): zlib-1.2.7-19.el7_9.x86_64.rpm | 90 kB 00:00:00
(25/29): zlib-devel-1.2.7-19.el7_9.x86_64.rpm | 50 kB 00:00:00
(26/29): glibc-devel-2.17-324.el7_9.x86_64.rpm | 1.1 MB 00:00:16
(27/29): libcurl-7.29.0-59.el7_9.1.x86_64.rpm | 223 kB 00:00:12
(28/29): kernel-headers-3.10.0-1160.25.1.el7.x86_64.rpm | 9.0 MB 00:00:45
(29/29): gcc-4.8.5-44.el7.x86_64.rpm | 16 MB 00:01:41
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 586 kB/s | 58 MB 00:01:41
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : libgcc-4.8.5-44.el7.x86_64 1/41
Updating : glibc-common-2.17-324.el7_9.x86_64 2/41
Updating : glibc-2.17-324.el7_9.x86_64 3/41
Updating : zlib-1.2.7-19.el7_9.x86_64 4/41
Updating : libuuid-2.23.2-65.el7_9.1.x86_64 5/41
Updating : libblkid-2.23.2-65.el7_9.1.x86_64 6/41
Updating : libcurl-7.29.0-59.el7_9.1.x86_64 7/41
Installing : 1:perl-Error-0.17020-2.el7.noarch 8/41
Updating : libmount-2.23.2-65.el7_9.1.x86_64 9/41
Installing : cpp-4.8.5-44.el7.x86_64 10/41
Installing : m4-1.4.16-10.el7.x86_64 11/41
Installing : perl-TermReadKey-2.30-20.el7.x86_64 12/41
Installing : perl-Git-1.8.3.1-23.el7_8.noarch 13/41
Installing : git-1.8.3.1-23.el7_8.x86_64 14/41
Updating : libsmartcols-2.23.2-65.el7_9.1.x86_64 15/41
Installing : perl-Data-Dumper-2.145-3.el7.x86_64 16/41
Installing : autoconf-2.69-11.el7.noarch 17/41
Updating : libgomp-4.8.5-44.el7.x86_64 18/41
Installing : kernel-headers-3.10.0-1160.25.1.el7.x86_64 19/41
Installing : glibc-headers-2.17-324.el7_9.x86_64 20/41
Installing : glibc-devel-2.17-324.el7_9.x86_64 21/41
Installing : perl-Thread-Queue-3.02-2.el7.noarch 22/41
Installing : perl-Test-Harness-3.28-3.el7.noarch 23/41
Installing : automake-1.13.4-3.el7.noarch 24/41
Installing : gcc-4.8.5-44.el7.x86_64 25/41
Updating : util-linux-2.23.2-65.el7_9.1.x86_64 26/41
Updating : curl-7.29.0-59.el7_9.1.x86_64 27/41
Installing : libuuid-devel-2.23.2-65.el7_9.1.x86_64 28/41
Installing : zlib-devel-1.2.7-19.el7_9.x86_64 29/41
Cleanup : util-linux-2.23.2-61.el7.x86_64 30/41
Cleanup : libmount-2.23.2-61.el7.x86_64 31/41
Cleanup : curl-7.29.0-54.el7.x86_64 32/41
Cleanup : libcurl-7.29.0-54.el7.x86_64 33/41
Cleanup : libblkid-2.23.2-61.el7.x86_64 34/41
Cleanup : libuuid-2.23.2-61.el7.x86_64 35/41
Cleanup : zlib-1.2.7-18.el7.x86_64 36/41
Cleanup : libsmartcols-2.23.2-61.el7.x86_64 37/41
Cleanup : libgomp-4.8.5-39.el7.x86_64 38/41
Cleanup : glibc-common-2.17-292.el7.x86_64 39/41
Cleanup : glibc-2.17-292.el7.x86_64 40/41
Cleanup : libgcc-4.8.5-39.el7.x86_64 41/41
Verifying : glibc-2.17-324.el7_9.x86_64 1/41
Verifying : zlib-1.2.7-19.el7_9.x86_64 2/41
Verifying : libblkid-2.23.2-65.el7_9.1.x86_64 3/41
Verifying : libmount-2.23.2-65.el7_9.1.x86_64 4/41
Verifying : automake-1.13.4-3.el7.noarch 5/41
Verifying : m4-1.4.16-10.el7.x86_64 6/41
Verifying : git-1.8.3.1-23.el7_8.x86_64 7/41
Verifying : libuuid-devel-2.23.2-65.el7_9.1.x86_64 8/41
Verifying : perl-TermReadKey-2.30-20.el7.x86_64 9/41
Verifying : perl-Test-Harness-3.28-3.el7.noarch 10/41
Verifying : perl-Thread-Queue-3.02-2.el7.noarch 11/41
Verifying : cpp-4.8.5-44.el7.x86_64 12/41
Verifying : libsmartcols-2.23.2-65.el7_9.1.x86_64 13/41
Verifying : util-linux-2.23.2-65.el7_9.1.x86_64 14/41
Verifying : perl-Git-1.8.3.1-23.el7_8.noarch 15/41
Verifying : glibc-headers-2.17-324.el7_9.x86_64 16/41
Verifying : perl-Data-Dumper-2.145-3.el7.x86_64 17/41
Verifying : 1:perl-Error-0.17020-2.el7.noarch 18/41
Verifying : gcc-4.8.5-44.el7.x86_64 19/41
Verifying : zlib-devel-1.2.7-19.el7_9.x86_64 20/41
Verifying : libcurl-7.29.0-59.el7_9.1.x86_64 21/41
Verifying : curl-7.29.0-59.el7_9.1.x86_64 22/41
Verifying : autoconf-2.69-11.el7.noarch 23/41
Verifying : kernel-headers-3.10.0-1160.25.1.el7.x86_64 24/41
Verifying : libuuid-2.23.2-65.el7_9.1.x86_64 25/41
Verifying : glibc-devel-2.17-324.el7_9.x86_64 26/41
Verifying : libgcc-4.8.5-44.el7.x86_64 27/41
Verifying : libgomp-4.8.5-44.el7.x86_64 28/41
Verifying : glibc-common-2.17-324.el7_9.x86_64 29/41
Verifying : zlib-1.2.7-18.el7.x86_64 30/41
Verifying : util-linux-2.23.2-61.el7.x86_64 31/41
Verifying : libuuid-2.23.2-61.el7.x86_64 32/41
Verifying : libgcc-4.8.5-39.el7.x86_64 33/41
Verifying : libgomp-4.8.5-39.el7.x86_64 34/41
Verifying : glibc-common-2.17-292.el7.x86_64 35/41
Verifying : libblkid-2.23.2-61.el7.x86_64 36/41
Verifying : libmount-2.23.2-61.el7.x86_64 37/41
Verifying : glibc-2.17-292.el7.x86_64 38/41
Verifying : libcurl-7.29.0-54.el7.x86_64 39/41
Verifying : curl-7.29.0-54.el7.x86_64 40/41
Verifying : libsmartcols-2.23.2-61.el7.x86_64 41/41

Installed:
autoconf.noarch 0:2.69-11.el7 automake.noarch 0:1.13.4-3.el7 gcc.x86_64 0:4.8.5-44.el7 git.x86_64 0:1.8.3.1-23.el7_8
libuuid-devel.x86_64 0:2.23.2-65.el7_9.1 zlib-devel.x86_64 0:1.2.7-19.el7_9

Dependency Installed:
cpp.x86_64 0:4.8.5-44.el7 glibc-devel.x86_64 0:2.17-324.el7_9 glibc-headers.x86_64 0:2.17-324.el7_9
kernel-headers.x86_64 0:3.10.0-1160.25.1.el7 m4.x86_64 0:1.4.16-10.el7 perl-Data-Dumper.x86_64 0:2.145-3.el7
perl-Error.noarch 1:0.17020-2.el7 perl-Git.noarch 0:1.8.3.1-23.el7_8 perl-TermReadKey.x86_64 0:2.30-20.el7
perl-Test-Harness.noarch 0:3.28-3.el7 perl-Thread-Queue.noarch 0:3.02-2.el7

Updated:
curl.x86_64 0:7.29.0-59.el7_9.1

Dependency Updated:
glibc.x86_64 0:2.17-324.el7_9 glibc-common.x86_64 0:2.17-324.el7_9 libblkid.x86_64 0:2.23.2-65.el7_9.1 libcurl.x86_64 0:7.29.0-59.el7_9.1
libgcc.x86_64 0:4.8.5-44.el7 libgomp.x86_64 0:4.8.5-44.el7 libmount.x86_64 0:2.23.2-65.el7_9.1 libsmartcols.x86_64 0:2.23.2-65.el7_9.1
libuuid.x86_64 0:2.23.2-65.el7_9.1 util-linux.x86_64 0:2.23.2-65.el7_9.1 zlib.x86_64 0:1.2.7-19.el7_9

Complete!
[root@netdata-server yum.repos.d]#

Step 3: Clone the Netdata git repository 

$ git clone https://github.com/netdata/netdata.git --depth=100

Sample Output:

[root@netdata-server ~]# git clone https://github.com/netdata/netdata.git --depth=100
Cloning into 'netdata'...
remote: Enumerating objects: 2839, done.
remote: Counting objects: 100% (2839/2839), done.
remote: Compressing objects: 100% (2193/2193), done.
remote: Total 2839 (delta 1026), reused 1304 (delta 577), pack-reused 0
Receiving objects: 100% (2839/2839), 6.57 MiB | 1.67 MiB/s, done.
Resolving deltas: 100% (1026/1026), done.
[root@netdata-server ~]# ll
total 12
-rw-------. 1 root root 1899 Sep 20 2019 anaconda-ks.cfg
-rw-r--r--. 1 root root 1930 Sep 20 2019 initial-setup-ks.cfg
drwxr-xr-x. 30 root root 4096 May 9 04:29 netdata
[root@netdata-server ~]#

Step 4: Goto Netdata directory and run install-required-packages.sh script

Basically, this script will install all required package for installing Netdata.

$ cd netdata/

$ ./packaging/installer/install-required-packages.sh --dont-wait --non-interactive netdata 

For my CentOS system it will install the package as shown below screenshot:

Monitor Performance Of CentOS Server Using Netdata

Step 5: Install Netdata

After running netdata-installer.sh script it will take some time (few mins) to install and configure Netdata.

$ sudo ./netdata-installer.sh

Monitor Performance Of CentOS Server Using Netdata

Monitor Performance Of CentOS Server Using Netdata

Step 6: Command to start and enable Netdata service

$ sudo systemctl start netdata

$ sudo systemctl enable netdata

$ sudo systemctl status netdata

Monitor Performance Of CentOS Server Using Netdata

Step 7: Verify Netdata port using Netstat command

$ sudo netstat -pnltu | grep netdata

Monitor Performance Of CentOS Server Using Netdata

Step 8: Configure the firewall to access Netdata

$ sudo firewall-cmd --add-port=19999/tcp --permanent

$ sudo firewall-cmd --reload

Sample output:

[root@netdata-server netdata]# sudo firewall-cmd --add-port=19999/tcp --permanent
success
[root@netdata-server netdata]# sudo firewall-cmd --reload
success
[root@netdata-server netdata]#

Step 9: Access Netdata on web-browser

$ http://your-system-ip:19999/

Once you login into Netdata, you’ll see all system performance on the Netdata dashboard.

Monitor Performance Of CentOS Server Using Netdata

Explore more Netdata metrics by clicking on them.

System service

Monitor Performance Of CentOS Server Using Netdata

Steps to configure Netdata with Authentication 

By default, Netdata doesn’t provide any kind of authentication, and the Netdata dashboard can be accessible by anyone. So we will use Nginx reverse proxy and configure basic authentication on Netdata.

Step 1: Install Nginx on CentOS 

$ yum install nginx

Monitor Performance Of CentOS Server Using Netdata

Sample Output:

[root@netdata-server ~]# sudo dnf install nginx
sudo: dnf: command not found
You have new mail in /var/spool/mail/root
[root@netdata-server ~]# yum intall ^C
[root@netdata-server ~]# yum install nginx
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror-hk.koddos.net
* epel: ftp.iij.ad.jp
* extras: mirror-hk.koddos.net
* updates: mirror-hk.koddos.net
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 1:1.16.1-3.el7 will be installed
--> Processing Dependency: nginx-all-modules = 1:1.16.1-3.el7 for package: 1:nginx-1.16.1-3.el7.x86_64
--> Processing Dependency: nginx-filesystem = 1:1.16.1-3.el7 for package: 1:nginx-1.16.1-3.el7.x86_64
--> Processing Dependency: libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) for package: 1:nginx-1.16.1-3.el7.x86_64
--> Processing Dependency: libssl.so.1.1(OPENSSL_1_1_0)(64bit) for package: 1:nginx-1.16.1-3.el7.x86_64
--> Processing Dependency: libssl.so.1.1(OPENSSL_1_1_1)(64bit) for package: 1:nginx-1.16.1-3.el7.x86_64
--> Processing Dependency: nginx-filesystem for package: 1:nginx-1.16.1-3.el7.x86_64
--> Processing Dependency: libcrypto.so.1.1()(64bit) for package: 1:nginx-1.16.1-3.el7.x86_64
--> Processing Dependency: libssl.so.1.1()(64bit) for package: 1:nginx-1.16.1-3.el7.x86_64
--> Running transaction check
---> Package nginx-all-modules.noarch 1:1.16.1-3.el7 will be installed
--> Processing Dependency: nginx-mod-http-image-filter = 1:1.16.1-3.el7 for package: 1:nginx-all-modules-1.16.1-3.el7.noarch
--> Processing Dependency: nginx-mod-http-perl = 1:1.16.1-3.el7 for package: 1:nginx-all-modules-1.16.1-3.el7.noarch
--> Processing Dependency: nginx-mod-http-xslt-filter = 1:1.16.1-3.el7 for package: 1:nginx-all-modules-1.16.1-3.el7.noarch
--> Processing Dependency: nginx-mod-mail = 1:1.16.1-3.el7 for package: 1:nginx-all-modules-1.16.1-3.el7.noarch
--> Processing Dependency: nginx-mod-stream = 1:1.16.1-3.el7 for package: 1:nginx-all-modules-1.16.1-3.el7.noarch
---> Package nginx-filesystem.noarch 1:1.16.1-3.el7 will be installed
---> Package openssl11-libs.x86_64 1:1.1.1g-3.el7 will be installed
--> Running transaction check
---> Package nginx-mod-http-image-filter.x86_64 1:1.16.1-3.el7 will be installed
---> Package nginx-mod-http-perl.x86_64 1:1.16.1-3.el7 will be installed
---> Package nginx-mod-http-xslt-filter.x86_64 1:1.16.1-3.el7 will be installed
---> Package nginx-mod-mail.x86_64 1:1.16.1-3.el7 will be installed
---> Package nginx-mod-stream.x86_64 1:1.16.1-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================
Installing:
nginx x86_64 1:1.16.1-3.el7 epel 563 k
Installing for dependencies:
nginx-all-modules noarch 1:1.16.1-3.el7 epel 20 k
nginx-filesystem noarch 1:1.16.1-3.el7 epel 21 k
nginx-mod-http-image-filter x86_64 1:1.16.1-3.el7 epel 30 k
nginx-mod-http-perl x86_64 1:1.16.1-3.el7 epel 39 k
nginx-mod-http-xslt-filter x86_64 1:1.16.1-3.el7 epel 29 k
nginx-mod-mail x86_64 1:1.16.1-3.el7 epel 57 k
nginx-mod-stream x86_64 1:1.16.1-3.el7 epel 85 k
openssl11-libs x86_64 1:1.1.1g-3.el7 epel 1.5 M

Transaction Summary
===================================================================================================================================
Install 1 Package (+8 Dependent packages)

Total download size: 2.3 M
Installed size: 5.5 M
Is this ok [y/d/N]: y
Downloading packages:
(1/9): nginx-mod-http-image-filter-1.16.1-3.el7.x86_64.rpm | 30 kB 00:00:08
(2/9): nginx-all-modules-1.16.1-3.el7.noarch.rpm | 20 kB 00:00:08
(3/9): nginx-filesystem-1.16.1-3.el7.noarch.rpm | 21 kB 00:00:09
(4/9): nginx-1.16.1-3.el7.x86_64.rpm | 563 kB 00:00:11
(5/9): nginx-mod-http-perl-1.16.1-3.el7.x86_64.rpm | 39 kB 00:00:00
(6/9): nginx-mod-http-xslt-filter-1.16.1-3.el7.x86_64.rpm | 29 kB 00:00:00
(7/9): nginx-mod-stream-1.16.1-3.el7.x86_64.rpm | 85 kB 00:00:00
(8/9): nginx-mod-mail-1.16.1-3.el7.x86_64.rpm | 57 kB 00:00:00
(9/9): openssl11-libs-1.1.1g-3.el7.x86_64.rpm | 1.5 MB 00:00:04
-----------------------------------------------------------------------------------------------------------------------------------
Total 140 kB/s | 2.3 MB 00:00:16
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:openssl11-libs-1.1.1g-3.el7.x86_64 1/9
Installing : 1:nginx-filesystem-1.16.1-3.el7.noarch 2/9
Installing : 1:nginx-mod-mail-1.16.1-3.el7.x86_64 3/9
Installing : 1:nginx-mod-http-perl-1.16.1-3.el7.x86_64 4/9
Installing : 1:nginx-mod-http-xslt-filter-1.16.1-3.el7.x86_64 5/9
Installing : 1:nginx-mod-http-image-filter-1.16.1-3.el7.x86_64 6/9
Installing : 1:nginx-1.16.1-3.el7.x86_64 7/9
Installing : 1:nginx-mod-stream-1.16.1-3.el7.x86_64 8/9
Installing : 1:nginx-all-modules-1.16.1-3.el7.noarch 9/9
Verifying : 1:nginx-mod-stream-1.16.1-3.el7.x86_64 1/9
Verifying : 1:nginx-mod-mail-1.16.1-3.el7.x86_64 2/9
Verifying : 1:nginx-mod-http-perl-1.16.1-3.el7.x86_64 3/9
Verifying : 1:nginx-1.16.1-3.el7.x86_64 4/9
Verifying : 1:nginx-filesystem-1.16.1-3.el7.noarch 5/9
Verifying : 1:nginx-mod-http-xslt-filter-1.16.1-3.el7.x86_64 6/9
Verifying : 1:nginx-all-modules-1.16.1-3.el7.noarch 7/9
Verifying : 1:nginx-mod-http-image-filter-1.16.1-3.el7.x86_64 8/9
Verifying : 1:openssl11-libs-1.1.1g-3.el7.x86_64 9/9

Installed:
nginx.x86_64 1:1.16.1-3.el7

Dependency Installed:
nginx-all-modules.noarch 1:1.16.1-3.el7 nginx-filesystem.noarch 1:1.16.1-3.el7
nginx-mod-http-image-filter.x86_64 1:1.16.1-3.el7 nginx-mod-http-perl.x86_64 1:1.16.1-3.el7
nginx-mod-http-xslt-filter.x86_64 1:1.16.1-3.el7 nginx-mod-mail.x86_64 1:1.16.1-3.el7
nginx-mod-stream.x86_64 1:1.16.1-3.el7 openssl11-libs.x86_64 1:1.1.1g-3.el7

Complete!
[root@netdata-server ~]#

Step 2: Configure Nginx

$ sudo vim /etc/nginx/conf.d/default.conf

Make changes to the below server_ip and example.com directives with your own server IP address and server name.

upstream netdata-backend {
server 127.0.0.1:19999;
keepalive 64;
}

server {
listen server_ip:80;
server_name example.com;

auth_basic "Authentication Required";
auth_basic_user_file netdata-access;

location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://netdata-backend;
proxy_http_version 1.1;
proxy_pass_request_headers on;
proxy_set_header Connection "keep-alive";
proxy_store off;
}
}

In my case I configured as mention in screenshot:

Monitor Performance Of CentOS Server Using Netdata

Sample Output:

[root@netdata-server netdata]# sudo cat /etc/nginx/conf.d/default.conf
upstream netdata-backend {
server 127.0.0.1:19999;
keepalive 64;
}

server {
listen 192.168.245.72:80;
server_name netdata.sysadminxpert.com;

auth_basic "Authentication Required";
auth_basic_user_file /etc/nginx/netdata-access;

location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://netdata-backend;
proxy_http_version 1.1;
proxy_pass_request_headers on;
proxy_set_header Connection "keep-alive";
proxy_store off;
}
}
[root@netdata-server netdata]#

Test the Nginx config:

nginx -t

Sample Output:

[root@netdata-server conf.d]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@netdata-server conf.d]#

Step 3: Install httpd-tools

$ sudo yum install httpd-tools

Monitor Performance Of CentOS Server Using Netdata

Sample Output:

[root@netdata-server ~]# yum install httpd-tools
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: centos.mirror.snu.edu.in
* epel: mirrors.bestthaihost.com
* epel-source: mirrors.bestthaihost.com
* extras: centos.mirror.snu.edu.in
* updates: centos.mirror.snu.edu.in
Resolving Dependencies
--> Running transaction check
---> Package httpd-tools.x86_64 0:2.4.6-97.el7.centos will be installed
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-tools-2.4.6-97.el7.centos.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-tools-2.4.6-97.el7.centos.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.4.8-7.el7 will be installed
---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================
Installing:
httpd-tools x86_64 2.4.6-97.el7.centos updates 93 k
Installing for dependencies:
apr x86_64 1.4.8-7.el7 base 104 k
apr-util x86_64 1.5.2-6.el7 base 92 k

Transaction Summary
===================================================================================================================================
Install 1 Package (+2 Dependent packages)

Total download size: 289 k
Installed size: 584 k
Is this ok [y/d/N]: y
Downloading packages:
(1/3): httpd-tools-2.4.6-97.el7.centos.x86_64.rpm | 93 kB 00:00:10
(2/3): apr-util-1.5.2-6.el7.x86_64.rpm | 92 kB 00:00:10
(3/3): apr-1.4.8-7.el7.x86_64.rpm | 104 kB 00:00:10
-----------------------------------------------------------------------------------------------------------------------------------
Total 27 kB/s | 289 kB 00:00:10
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : apr-1.4.8-7.el7.x86_64 1/3
Installing : apr-util-1.5.2-6.el7.x86_64 2/3
Installing : httpd-tools-2.4.6-97.el7.centos.x86_64 3/3
Verifying : apr-1.4.8-7.el7.x86_64 1/3
Verifying : apr-util-1.5.2-6.el7.x86_64 2/3
Verifying : httpd-tools-2.4.6-97.el7.centos.x86_64 3/3

Installed:
httpd-tools.x86_64 0:2.4.6-97.el7.centos

Dependency Installed:
apr.x86_64 0:1.4.8-7.el7 apr-util.x86_64 0:1.5.2-6.el7

Complete!
[root@netdata-server ~]#

Step 4: Create username and password using htpasswd tool 

$ sudo htpasswd -c /etc/nginx/netdata-access sysadminxpert

Sample output:

[root@netdata-server ~]# sudo htpasswd -c /etc/nginx/netdata-access sysadminxpert
New password:
Re-type new password:
Adding password for user sysadminxpert
[root@netdata-server ~]#

Step 5: Allow 80 port in firewalld:

$ firewall-cmd --zone=public --permanent --add-service=http

Step 6: Configure SELinux

Toggle the SELinux boolean value for httpd network connect to on (Nginx uses the httpd label).

setsebool httpd_can_network_connect on

To make the change persist use the -P flag.

setsebool httpd_can_network_connect on -P

You can see a list of all available SELinux booleans for httpd using the below command

getsebool -a | grep httpd

Step 7: Restart Nginx webserver

$ sudo systemctl restart nginx

Step 8: Access your server-ip on your browser

http://server-ip

Monitor Performance Of CentOS Server Using Netdata

Once you login you get the Netdata dashboard

Monitor Performance Of CentOS Server Using Netdata

You have been successfully installed Netdata.

Steps to Troubleshoot Netdata UI access (optional)

Check errors in the SELinux logs:

sudo cat /var/log/audit/audit.log | grep nginx | grep denied

Sample output:

type=AVC msg=audit(1620570863.097:1708): avc:  denied  { name_connect } for  pid=5031 comm="nginx" dest=19999 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket permissive=0

Run the below command to fix the issue:

setsebool -P httpd_can_network_connect 1

Still, you are not able to access the Netdata dashboard then follow the below steps:
Run the below command to fix the issue:

$ sudo cat /var/log/audit/audit.log | grep nginx | grep denied | audit2allow -M mynginx
$ sudo semodule -i mynginx.pp

Monitor Performance Of CentOS Server Using Netdata

End of article. you’ve learned how to Monitor Performance Of CentOS Server Using Netdata

See also:

List of monitoring tools 

Linux Blogs

AWS Cloud Blogs

Database Blogs

DevOps Blogs

Interview Questions & Answers

Docker Blogs

Google Cloud Blogs







1 thought on “Monitor Performance Of CentOS Server Using Netdata”

Comments are closed.