16 C
Texas
angeloma
Senior Writer and partner

How to install Netdata on Rocky Linux 8 / AlmaLinux 8 / CentOS 8

Hello, friends. These days we are very busy with the migration from CentOS 8 to Rocky Linux 8 and in this sense learning how to install monitoring tools can be helpful. So, in this post, you will learn how to install Netdata on Rocky Linux 8 / AlmaLinux 8 / CentOS 8.

Netdata is a tool to visualize and monitor metrics in real-time, optimized to accumulate all types of data. It is also optimized to accumulate all types of data, such as CPU usage, disk activity, SQL queries, website visits, etc. The tool is designed to visualize the now in as much detail as possible, allowing the user to get an overview of what is happening and what has just happened in your system or application.

Netdata is very easy to use

For the server monitoring conception conceived by Netdata, everything must be monitorable. It also has the following attributes.

  • Out of the box: netdata supports auto-detection for everything. It collects more than 5000 metrics automatically, with zero configuration
  • Basically, it can monitor practically in real-time and achieves this without sacrificing performance in its execution.
  • It is highly customizable thanks to HTML.
  • Extensible: Anything you can get a number for, can be given to netdata, using its Plugin API.
  • Scalable: netdata scales out, your web browser is the central netdata connecting all your servers

Install Netdata on Rocky Linux 8 / AlmaLinux 8 / CentOS 8

There are several methods to install Netdata. One of them is to deploy a Docker container.

- Advertisement -

Also, it is possible to install Netdata through RPM or DEB packages for Debian and derivatives.

However, from the Netdata website, they recommend that we use a script that will allow us to download, compile and install it all from a single command.

This method is also the most recommended because it enables the automatic update and guarantees total integration with the system.

So, let’s get started.

Once you have connected to your server, update it using this command

sudo dnf update

Then, run this command which is the official installation script.

sudo bash <(curl -Ss https://my-netdata.io/kickstart.sh)

This will start the whole process of installing the dependencies. During the process, you will be asked to accept the inclusion of new repositories such as EPEL and PowerTools.

Also, it will download the latest version of Netdata and compile it successfully. Then, it will include in the system, the service configuration file.

At the end of the whole process, you will see a screen indicating that the process has been successful. You will also see the address where you will have access to see the Netdata panel.

1.- Netdata on Rocky Linux 8 / AlmaLinux 8 / CentOS 8
1.- Netdata on Rocky Linux 8 / AlmaLinux 8 / CentOS 8

As you can see in the image, Netdata uses port 19999 which has to be available on the firewall.

So, start the netdata service

sudo systemctl enable --now netdata

Then, you can open your web browser and go to that address to see the Netdata dashboard.

2.- Netdata dashboard
2.- Netdata dashboard

Protect access to Netdata

In this step, we will configure Nginx as Reverse Proxy, enable HTTPS, and request a username and password to access the site. We do this so that not everyone can access the monitoring of our resources.

So, first, install Nginx and the httpd-tools package which will bring us the htpasswd command. I will also install nano as a text editor.

sudo dnf install nginx httpd-tools nano

Then, generate the user and the password to which we will allow access.

sudo htpasswd -c /etc/nginx/.htpasswd admin

Next, we will be prompted to create the password for the admin user which you can replace with another one.

Now create a new configuration file for Netdata.

sudo nano /etc/nginx/conf.d/netdata.conf

And add the following

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

server {
listen 80;
# the virtual host name of this
server_name angtest.ga;

    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://backend;
    proxy_http_version 1.1;   
    proxy_pass_request_headers on;
    proxy_set_header Connection "keep-alive";
    proxy_store off;
    auth_basic "Private Property";
    auth_basic_user_file /etc/nginx/.htpasswd;
}
}

Replace ServerName with the name of your domain.

The last step is to install Certbot and Let’s Encrypt certificates. Since we already have the EPEL repository enabled, then all we have to do is run this command

sudo dnf install certbot python3-certbot-nginx

So, generate the certificate for your site

sudo certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email [email] -d your-domain

Replace the email and -d values with your respective values.

To apply the changes, restart Nginx

sudo systemctl restart nginx

Now go to https://your-domain to log in and see the Netdata dashboard.

Conclusion

About Netdata you can say that it’s amazing how easy it is to use. Also, the app is really an Out-The-Box application because you simply don’t have to configure anything extra, it’s just installed and go.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article