FedoraRHEL Based

How To Install Cacti on Fedora 38

Install Cacti on Fedora 38

In this tutorial, we will show you how to install Cacti on Fedora 38. If you’re a network administrator, you know the importance of monitoring your network’s performance. One of the best tools for doing this is Cacti, an open-source network monitoring and graphing tool. Cacti allows you to gather data from a variety of sources and graph the results, making it easy to visualize your network’s performance.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Cacti monitoring on a Fedora 38.

Prerequisites

  • A server running one of the following operating systems: Fedora 38.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies for Cacti.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Cacti on Fedora 38

Step 1. Before proceeding, update your Fedora operating system to make sure all existing packages are up to date. Use this command to update the server packages:

sudo dnf upgrade
sudo dnf update

Step 2. Installing Apache.

Cacti requires a web server to run, and Apache is one of the most popular web servers available. To install Apache, run the following command in your terminal:

sudo dnf install httpd

After Apache is installed, you can start the service by running the following command:

sudo systemctl start httpd

You can verify that Apache is running by opening a web browser and navigating to http://localhost/. If Apache is working correctly, you should see the default Apache page.

Step 3. Installing PHP.

Cacti is written in PHP, so you’ll need to install PHP on your system. To install PHP, run the following command in your terminal:

sudo dnf install php php-mysqlnd php-snmp php-xml php-gd php-process php-mbstring

Step 4. Installing MariaDB.

Cacti requires a database to store its data, and MariaDB is one of the most popular databases available. To install MariaDB, run the following command in your terminal:

sudo dnf install mariadb-server mariadb

After MySQL is installed, you can start the service by running the following command:

sudo systemctl start mariadb

You can then secure the MySQL installation by running the following command:

sudo mysql_secure_installation

Now that you have MySQL installed, you need to create a database for Cacti to use. To do this, run the following commands in your terminal:

sudo mysql -u root -p

This will open the MySQL prompt. Enter your root password when prompted.

CREATE DATABASE cacti;
GRANT ALL PRIVILEGES ON cacti.* TO 'cactiuser'@'localhost' IDENTIFIED BY 'your-strong-password';
FLUSH PRIVILEGES;
exit;

Step 5. Installing Cacti on Fedora 38.

Now that you have all the necessary components installed, it’s time to install Cacti. First, add the Cacti repository to your system by running the following command:

sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

After the repository is added, you can install Cacti by running the following command:

sudo dnf install cacti

During the installation process, you will be prompted to configure the Cacti database settings. Use the following settings:

  • Database Type: MariaDB
  • Database Name: cacti
  • Database Host: localhost
  • Database Port: 3306
  • Username: cactiuser
  • Password: (the password you set earlier)

Once the installation is complete, you need to configure the Cacti database. To do this, run the following command in your terminal:

sudo cacti-db-scripts install

Step 6. Configure the Poller.

The final step in configuring Cacti is to configure the poller. The poller is responsible for collecting data from your devices and updating the Cacti database. To configure the poller, follow these steps:

cd /usr/share/cacti/
nano include/config.php

Edit the Cacti configuration file:

nano include/config.php

Find the following lines in the configuration file:

$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "your-strong-password";

Save the changes and exit the editor then, edit the Poller configuration file:

nano /etc/cron.d/cacti

Uncomment the following line by removing the “#” at the beginning of the line:

*/5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1

Save the changes and exit the editor, then restart the poller service:

sudo systemctl restart cacti

If you have got the firewalld running on your server, add the HTTP and HTTPS services to the firewalld using the command below:

sudo firewall-cmd add-service=http --permanent
sudo firewall-cmd --reload

Step 7. Accessing Cacti Monitoring Web Interface.

Once successfully installed, open your web browser and access the Cacti installation wizard using the URL http://your-ip-address/cacti. You will be redirected to the following page:

Install Cacti on Fedora 38

Congratulations! You have successfully installed Cacti. Thanks for using this tutorial for installing the Cacti on your Fedora 38 system. For additional help or useful information, we recommend you check the official Cacti website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to idroot.us, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button