We're here to assist with any of your needs, don't hestitate to reach out.
Cacti is an open-source network monitoring and graphing tool designed to provide real-time information about the health and performance of your network infrastructure. It leverages the power of RRDTool to store, retrieve, and display time-series data related to CPU usage, memory usage, network bandwidth utilization, and much more. Cacti is widely used by network administrators and system operators to monitor and manage their network environments.
Before installing Cacti, make sure that your CentOS 8 system is up to date by running the following command in the terminal:
sudo dnf update -y
Next, install the necessary dependencies for Cacti by running the following command:
sudo dnf install httpd mariadb-server mariadb php php-mysqlnd php-snmp php-xml php-gd net-snmp-utils -y
Cacti requires a MariaDB database to store its data. Start by enabling and starting the MariaDB service:
sudo systemctl enable --now mariadb
Secure the installation by running the following command and answering the prompts:
sudo mysql_secure_installation
Log in to the MariaDB shell using the root account:
sudo mysql -u root -p
Create a new database and user for Cacti:
CREATE DATABASE cacti;
GRANT ALL PRIVILEGES ON cacti.* TO 'cacti'@'localhost' IDENTIFIED BY 'cacti_password';
FLUSH PRIVILEGES;
EXIT;
Now it's time to install Cacti itself. First, enable and start the Apache web server:
sudo systemctl enable --now httpd
Download the latest version of Cacti from its official website using the following command:
sudo dnf install wget -y
wget https://www.cacti.net/downloads/cacti-latest.tar.gz
Extract the downloaded archive:
tar xzf cacti-latest.tar.gz
Move the extracted Cacti directory to the web server's document root:
sudo mv cacti-*/ /var/www/html/cacti
Import the Cacti database schema:
sudo mysql -u cacti -p cacti < /var/www/html/cacti/cacti.sql
Edit the Cacti configuration file to specify the database details:
sudo vi /var/www/html/cacti/include/config.php
Find the following lines and update them with your database details:
$database_type = 'mysql';
$database_default = 'cacti';
$database_hostname = 'localhost';
$database_username = 'cacti';
$database_password = 'cacti_password';
Save and close the file. Set the appropriate permissions:
sudo chown -R apache:apache /var/www/html/cacti/
sudo chmod -R 775 /var/www/html/cacti/rra/
sudo setsebool -P httpd_can_network_connect_db on
Cacti relies on a cron job to collect data and generate graphs. Open the cron table for editing:
sudo crontab -e
Add the following line at the end of the file:
* * * * * apache php /var/www/html/cacti/poller.php > /dev/null 2>&1
Save and close the file.
Open the following URL in your web browser:
http://your_server_ip/cacti/
Follow the web-based installer to set up your Cacti installation by providing the necessary information.
Congratulations! You have successfully installed Cacti on your CentOS 8 server. Enjoy monitoring and managing your network infrastructure.
What our customers say about us
Create your free account today.