Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Monitor Performance Of CentOS 8/7 Server Using Netdata - DesignLinux

Oct 30 2020
designlinux 0 Comments

There are tons of monitoring tools that are used for keeping an eye on systems performance and sending notifications in case something goes wrong. However, the installation and configuration steps involved are often tedious.

Netdata is an open-source real-time monitoring & troubleshooting tool that only requires a few steps to get installed. The Git repository comes with an automated script that handles the bulk of the installation and configuration process and takes away the cumbersome configuration associated with other monitoring tools.

Netdata has become hugely popular since its initial release in October 2013. It collects real-time metrics such as CPU and RAM usage, bandwidth statistics, and disk utilization and displays them on easy-to-interpret charts/graphs.

It has made huge leaps and bounds and this has earned it a place in Forbes 2020 Cloud 100 rising stars. This list constitutes the top 100 private cloud companies.

In this article, we will see how you can install Netdata on CentOS 8/7 to monitor real-time, performance, and health monitoring of servers and applications.

Supported Platforms

Netdata supports the following distributions:

  • CentOS 8 and CentOS 7
  • RHEL 8 and RHEL 7
  • Fedora Linux

How to Install Netdata in CentOS Linux

1. Before we dive into the installation of Netdata, a few prerequisite packages are mandatory. But first, update the system and install the EPEL repository as shown.

$ sudo yum update
$ sudo yum install epel-release

2. Next, install the requisite software packages as shown.

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

3. Once you are through with installing the prerequisite packages, clone the Netdata git repository as shown.

$ git clone https://github.com/netdata/netdata.git --depth=100
Git Clone Netdata in CentOS
Git Clone Netdata in CentOS

4. Next, navigate into the Netdata directory and execute the install-required-packages.sh script. The script detects your Linux distribution and installs additional packages that are required during the installation of Netdata.

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

5. Finally, to install Netdata, run the Netdata automated script as shown below.

$ sudo ./netdata-installer.sh

Upon execution of the script, you will be briefed on where crucial Netdata files will be stored. These include such as configuration files, web files, plugins, database files and log files to mention just a few.

Netdata Installation on CentOS
Netdata Installation on CentOS

6. Press ‘ENTER‘ to get underway with the installation process. During the installation process, you will be given some tips on how to access Netdata on the browser and manage the Netdata such as starting and stopping it.

Netdata Access Details
Netdata Access Details

The script runs for quite a while making all the necessary configurations and tweaks during the installation process. For my case, it took about 3-5 minutes, and once done, the output displayed should be a confirmation that the installation was successful.

Netdata Installation Summary
Netdata Installation Summary

7. Once installed, we need to have the Netdata daemon up and running. To start, enable the Netdata daemon on boot, and verify the status invoke the following commands:

$ sudo systemctl start netdata
$ sudo systemctl enable netdata
$ sudo systemctl status netdata
Verify Netdata Status
Verify Netdata Status

8. By default, Netdata listens on port 19999 and you can confirm this using the netstat command as shown:

$ sudo netstat -pnltu | grep netdata
Check Netdata Listening Port
Check Netdata Listening Port

9. We need to open this port on the firewall to have access to Netdata via a browser. Therefore run the commands below:

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

10. To access Netdata, fire up your browser, and browse the URL as shown:

$ http://centos8-ip:19999/

You will get a dashboard shown giving you the overall system performance on intuitive and cool graphs.

Netdata CentOS Server Monitoring
Netdata CentOS Server Monitoring

Feel free to have a glance at different graphs by clicking on the metrics listed on the right sidebar. For example, to have a glimpse of the systemd services running, click on the ‘systemd services’ option as shown.

Monitor Services on CentOS
Monitor Services on CentOS

Securing Netdata with Basic Authentication on CentOS

As you might alarmingly have observed, there’s no form of authentication provided by Netdata. This implies that virtually anyone can access the dashboard provided they get a hold of Netdata’s IP address.

Thankfully, we can configure basic authentication using the htpasswd program and the Nginx web server as the reverse proxy. Therefore, we are going to install the Nginx web server.

$ sudo dnf install nginx

With Nginx installed, we are going to create a configuration file inside the /etc/nginx/conf.d directory. However, feel free to use the sites-available directory if you are using Nginx for other purposes aside from Netdata.

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

Add the following entire configuration and make sure to change the 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;
    }
}

For user authentication, we will create a username and password for a user called tecmint using the htpasswd tool and keep the credentials under the netdata-access file.

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

Provide the password and confirm it.

Enable Basic Authentication for Netdata
Enable Basic Authentication for Netdata

Next, restart the Nginx web server for the changes to come into effect.

$ sudo systemctl restart nginx

To test if the configuration went right, proceed and browse your server’s IP address.

http://server-ip
Netdata User Login
Netdata User Login

Thereafter, you will get access to the Netdata dashboard.

Access Netdata with User Authentication
Access Netdata with User Authentication

And that’s it, folks. We have walked you through the installation of the Netdata Monitoring tool on CentOS 8 and configured basic authentication to secure the monitoring tool. Send us a shout and let us know how it went.

Related

Tags: CentOS Server Monitoring, CentOS Tips, Netdata Monitoring Tool, RHEL Tips

Bash break and continue

Prev Post

How to Install LibreOffice 7.0 on Ubuntu 20.04

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 608
  • 1,055,380

DesignLinux.com © All rights reserved

Go to mobile version