1080*80 ad

Installing Monitorix on CentOS 8

Step-by-Step Guide: Installing Monitorix on CentOS 8, Rocky Linux & AlmaLinux

Understanding your server’s performance is critical for maintaining stability, security, and efficiency. Monitorix is a powerful, lightweight, and open-source monitoring tool designed to track system and network resources. It generates easy-to-read graphs that provide at-a-glance insights into everything from system load and memory usage to network traffic and application performance.

This comprehensive guide will walk you through the process of installing and configuring Monitorix on a CentOS 8 server. While CentOS 8 has reached its End-of-Life (EOL), these instructions are fully compatible with its popular derivatives, Rocky Linux and AlmaLinux.

Prerequisites

Before we begin, ensure you have the following:

  • A running server with CentOS 8, Rocky Linux 8, or AlmaLinux 8.
  • Access to a user account with sudo or root privileges.
  • A stable internet connection to download the necessary packages.

Step 1: Update Your System and Install Dependencies

The first step in any software installation is to ensure your system is up-to-date. This helps prevent package conflicts and applies the latest security patches.

Open your terminal and run the following command:

sudo dnf update -y

Next, we need to install the Extra Packages for Enterprise Linux (EPEL) repository. The EPEL repo provides essential third-party software packages that are not included in the default CentOS repositories, including Monitorix and its dependencies.

sudo dnf install epel-release -y

With the EPEL repository enabled, we can now install the core dependencies that Monitorix relies on to function correctly. These include tools for creating graphs and various Perl modules.

sudo dnf install rrdtool rrdtool-perl perl-libwww-perl perl-Mail-MIMEDecoder perl-CGI perl-DBI perl-XML-Simple perl-Config-General perl-HTTP-Server-Simple -y

This single command installs all required components, ensuring a smooth installation process.

Step 2: Install Monitorix

Now that the dependencies are in place, installing Monitorix is straightforward. Since it’s available in the EPEL repository we just added, we can install it directly using the dnf package manager.

Execute the following command to install Monitorix:

sudo dnf install monitorix -y

The system will now download and install the Monitorix package along with any remaining dependencies.

Step 3: Start and Enable the Monitorix Service

After the installation is complete, the Monitorix service needs to be started and enabled to run automatically on system boot.

First, start the service using systemctl:

sudo systemctl start monitorix

Next, enable it to ensure it launches every time you restart your server:

sudo systemctl enable monitorix

To verify that the service is running without any errors, you can check its status:

sudo systemctl status monitorix

You should see an output indicating that the service is active (running).

Step 4: Configure the Firewall

By default, Monitorix runs its built-in web server on port 8080. To access the web interface from an external machine, you must allow traffic through this port in your system’s firewall.

Use the following firewall-cmd commands to add a permanent rule for port 8080 and reload the firewall to apply the changes:

sudo firewall-cmd --permanent --add-port=8080/tcp
sudo firewall-cmd --reload

If you receive an error, it may mean firewalld is not running. In that case, ensure it is installed and enabled.

Step 5: Access the Monitorix Web Interface

With the installation and configuration complete, you can now access the Monitorix dashboard. Open your favorite web browser and navigate to the following address, replacing your-server-ip with your server’s actual IP address:

http://your-server-ip:8080/monitorix

You will be greeted with the Monitorix dashboard, which will immediately begin displaying real-time and historical performance graphs for your system. You can explore various metrics, including system load, kernel usage, disk I/O, and network traffic.

Important Security Recommendations

The default Monitorix installation is accessible to anyone who knows your server’s IP address and the correct port. For any production environment, it is highly recommended to secure the web interface.

  1. Password Protection: You can enable basic authentication within the Monitorix configuration file, located at /etc/monitorix/monitorix.conf. Look for the <auth> section and configure a username and password.
  2. Use a Reverse Proxy: A more robust solution is to place Monitorix behind a reverse proxy like Nginx or Apache. This allows you to implement SSL/TLS encryption (HTTPS), restrict access by IP address, and integrate more advanced authentication methods.
  3. Change the Default Port: While not a security measure on its own, changing the port from the default 8080 in the configuration file can help reduce exposure to automated scans.

By following these steps, you have successfully deployed a powerful system monitoring solution that provides invaluable insights into your server’s health and performance.

Source: https://kifarunix.com/install-monitorix-on-centos-8/

900*80 ad

      1080*80 ad