Install and Configure Netdata on Rocky Linux 8 | Easy Monitoring

Posted on

Install and Configure Netdata on Rocky Linux 8 | Easy Monitoring

In this guide, we will walk you through the process of How To Install and Configure Netdata on Rocky Linux 8. Netdata is an open-source, distributed, and real-time infrastructure monitoring platform. It meticulously tracks the performance and health of various environments, employing a per-second metric approach for comprehensive monitoring. This granular level of detail allows for immediate identification of performance bottlenecks and potential issues.

You can now proceed to the guide steps below on the Orcacore website to set up the Netdata monitoring tool on Rocky Linux 8.

To complete this guide, you must log in to your server as a non-root user with sudo privileges and set up a basic firewall. To do this, you can follow our guide on the Initial Server Setup with Rocky Linux 8.

1. Install Netdata Monitoring Tool on Rocky Linux 8

First, you need to update your local package index with the following command:

sudo dnf update -y

Then, you need to install the Epel release on Rocky Linux 8 with the command below:

sudo dnf install epel-release -y

Netdata installation on Rocky Linux 8 needs some required packages, install them with the command below:

sudo dnf install git libuuid-devel autoconf automake pkgconfig zlib-devel curl findutils libmnl gcc make -y

Here we install Netdata from GitHub. First, clone the Netdata with the following command:

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

Then, switch to the Netdata directory with the command below:

cd netdata

You need to install some required packages here with the following commands:

sudo dnf --enablerepo=powertools install autoconf-archive autogen libuv-devel
sudo ./packaging/installer/install-required-packages.sh --non-interactive --dont-wait netdata

Run Netdata Installer Script

Now run the script below to build and install Netdata on Rocky Linux 8:

sudo ./netdata-installer.sh
build and install Netdata

When your installation is completed, proceed to the next step.

Manage Netdata Service

At this point, you need to start your Netdata service with the command below:

sudo systemctl start netdata

To enable your service to start at boot, run the following command:

sudo systemctl enable netdata

Verify that your Netdata service is active and running on Rocky Linux 8 with the command below:

sudo systemctl status netdata

In your output, you will see:

2. Configure Firewall For Netdata

At this point, we assumed that you have enabled firewalld. By default, Netdata listens on port 19999.

Now you need to allow traffic for Netdata through the Rocky Linux 8 firewall with the command below:

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

Then, reload the firewall to apply the new rules:

sudo firewall-cmd --reload

3. Access Netdata Dashboard

Here you can access the Netdata dashboard on Rocky Linux 8 by typing your server’s IP address in your web browser, followed by 19999:

http://<server-ip-address>:19999

You will get your system overview on the Netdata dashboard:

With Netdata, you can collect any available metric (on a per-second basis) from your systems and apps using more than 300 agent collectors or the Kubernetes service discovery. You can then visualize all collected data via charts or insights using the cloud-based Netdata dashboard. With access to such data, you can monitor the health and performance with the pre-configured alarms, detect and analyze anomalies, store metrics data for months, and export them to other systems.

For more information, you can visit the Netdata Documentation page.

Conclusion

At this point, you have learned to install and Configure Netdata on Rocky Linux 8. Installing and configuring Netdata on Rocky Linux 8 is simple. Use the official one-liner script. Once installed, start and enable the Netdata service to monitor system performance in real time.

Hope you enjoy it. You may also like to read the following articles:

Install and Configure Zabbix 6.0 on Rocky Linux 8

Install and Configure Grafana on Rocky Linux 8

Install Python 3.13 on Rocky Linux

Install Bitwarden on Rocky Linux

Alternative Installation Methods for Netdata on Rocky Linux 8

While the provided method of installing Netdata from GitHub is valid, there are alternative approaches that can streamline the process and potentially offer better long-term maintainability. Here are two such methods:

1. Using the Netdata Package Repository:

Netdata provides its own package repository, which simplifies installation and ensures you receive updates directly from the source. This method generally offers a more stable and reliable experience compared to building from source.

Explanation:

This approach utilizes the yum package manager (which dnf replaced, but still has a compatibility layer) to install Netdata. By adding the Netdata repository to your system, you allow dnf to manage the installation and updates seamlessly. This is generally considered best practice for software installation on RPM-based systems like Rocky Linux 8.

Code Example:

# Add the Netdata repository
sudo tee /etc/yum.repos.d/netdata.repo <<EOL
[netdata]
name = Netdata
baseurl = https://packagecloud.io/netdata/netdata/el/8/$basearch
enabled = 1
gpgcheck = 1
repo_gpgcheck = 1
gpgkey = https://packagecloud.io/netdata/netdata/gpgkey
sslverify = 1
sslcacert = /etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
EOL

# Install Netdata
sudo dnf install netdata -y

# Start and enable the Netdata service
sudo systemctl start netdata
sudo systemctl enable netdata

# Verify the service status
sudo systemctl status netdata

This script first adds the Netdata repository configuration to your system’s yum.repos.d directory. It then installs the netdata package using dnf. Finally, it starts and enables the Netdata service, ensuring it runs on boot.

2. Using Docker:

Docker provides a containerized solution for running Netdata, which can be particularly useful in environments where you want to isolate Netdata from the host system or quickly deploy it across multiple machines.

Explanation:

Docker containers provide a lightweight and isolated environment for running applications. Using the official Netdata Docker image simplifies deployment and management. This is a good option if you are already using Docker in your environment.

Code Example:

First, make sure Docker is installed and running on your Rocky Linux 8 system. If not, install it:

sudo dnf install docker -y
sudo systemctl start docker
sudo systemctl enable docker

Then, run the following Docker command to deploy Netdata:

docker run -d --name=netdata 
    -p 19999:19999 
    --cap-add SYS_PTRACE 
    --cap-add SYS_ADMIN 
    --volume /proc:/host/proc:ro 
    --volume /sys:/host/sys:ro 
    --volume /var/run/docker.sock:/var/run/docker.sock:ro 
    netdata/netdata

This command pulls the official Netdata Docker image from Docker Hub, creates a container named netdata, maps port 19999 on the host to the container, and mounts the host’s /proc and /sys directories as read-only volumes to allow Netdata to collect system metrics. The /var/run/docker.sock mount enables Netdata to monitor Docker containers as well. The --cap-add options provide the necessary privileges for Netdata to access system information.

After running this command, you can access the Netdata dashboard by navigating to http://<server-ip-address>:19999 in your web browser, just as with the original installation method.

These alternative methods provide different approaches to installing and configuring Netdata on Rocky Linux 8, each with its own advantages and disadvantages. Choosing the best method depends on your specific needs and environment. Remember to configure the firewall as described in the original article after using either of these methods. Regardless of the installation method chosen, the goal remains the same: to Install and Configure Netdata on Rocky Linux 8 for robust system monitoring. Install and Configure Netdata on Rocky Linux 8 empowers you to proactively manage your server’s performance.