To install and configure Cacti, a network graphing tool, on Red Hat Enterprise Linux (RHEL) or CentOS, follow these steps:
sudo yum install httpd php mariadb-server
sudo systemctl start httpd sudo systemctl enable httpd sudo systemctl start mariadb sudo systemctl enable mariadb
sudo mysql -u root CREATE DATABASE cacti; GRANT ALL ON cacti.* TO 'cactiuser'@'localhost' IDENTIFIED BY 'password'; FLUSH PRIVILEGES; exit
Replace password
with a strong password of your choice.
Install Cacti. Download the latest version of Cacti from the official website (https://www.cacti.net/downloads/), and extract the files to the web server's document root (usually /var/www/html/
).
Configure Cacti. Open your web browser and navigate to http://localhost/cacti/install/
, and follow the prompts to complete the installation. During the installation process, you will be asked to provide the database details you created in step 3 (database name, username, and password).
Configure the Cacti cron job. Cacti uses a cron job to poll the devices on your network and update the graphs. To configure the cron job, open the crontab
file for the Apache user (usually www-data
) using the following command:
sudo crontab -u www-data -e
Then, add the following line to the end of the file to run the Cacti poller every 5 minutes:
*/5 * * * * /usr/bin/php /var/www/html/cacti/poller.php > /dev/null 2>&1
Save and exit the crontab file.
After completing these steps, Cacti should be installed and configured on your system. You can log into the Cacti web interface using the username and password you specified during the installation process.