How to Install Cacti on Elementary OS Latest
Cacti is an open-source network monitoring and graphing tool that makes it easy to visualize and monitor network bandwidth, memory usage, CPU utilization and other key parameters. Installing Cacti on your Elementary OS is easy, and this guide will walk you through the process.
Prerequisites
- A working installation of Elementary OS Latest
- A user account with sudo privileges
Installing Prerequisites
Before we proceed with the installation of Cacti, we need to install some prerequisites. Open a terminal and run the following command:
sudo apt-get update
sudo apt-get install apache2 libapache2-mod-php7.4 mysql-server php7.4 php7.4-snmp php7.4-gd php7.4-mysql php7.4-cli php7.4-xml php7.4-mbstring snmp graphviz
This command will install the necessary packages to run Cacti on your Elementary OS system.
Installing Cacti
Once the prerequisite packages are installed, let’s move on to install Cacti from the official website. Follow the below steps to install Cacti on your system.
Download the latest Cacti version from http://www.cacti.net/downloads/cacti-latest.tar.gz. You can do this directly from the terminal using the
wgetcommand:wget http://www.cacti.net/downloads/cacti-latest.tar.gzExtract the downloaded file using the following command:
tar -xzf cacti-latest.tar.gzMove the extracted folder to the
/var/www/htmldirectory:sudo mv cacti-* /var/www/html/cactiCreate a MySQL database for Cacti and a separate user to access that database:
sudo mysql -u root -p mysql> CREATE DATABASE cacti; mysql> GRANT ALL PRIVILEGES ON cacti.* TO cacti@localhost IDENTIFIED BY '<your-password-here>'; mysql> FLUSH PRIVILEGES; mysql> exit;Replace
<your-password-here>with a secure password of your choice.Import the default Cacti database using the following command:
sudo mysql cacti < /var/www/html/cacti/cacti.sql -u cacti -pYou will be prompted to enter the password you set for the Cacti user in the previous step.
Open the Apache
config.phpfile with nano or your preferred text editor:sudo nano /var/www/html/cacti/include/config.phpUpdate the following lines in the
config.phpfile with your database details:$database_type = "mysql"; $database_default = "cacti"; $database_hostname = "localhost"; $database_username = "cacti"; $database_password = "<your-password-here>";Save and close the
config.phpfile.
Configuring Cacti
Now that we have installed Cacti, we need to configure it to start monitoring our network.
Open a web browser and go to
http://localhost/cacti.You should see the Cacti installation page. Click the "Start" button to begin the installation process.
On the next page, select the “New Install” option and click “Next”.
On the next page, review the system checks to make sure everything is correct. Then click “Next”.
On the following page, enter the MySQL database details you created earlier.
On the next page, enter a name and password for the default Cacti user.
Finally, click “Finish” to complete the installation.
Conclusion
Now that you have successfully installed Cacti on your Elementary OS system, you can start using it to monitor your network. Cacti provides a wide range of graphs for monitoring your network's performance, including bandwidth usage, CPU utilization, and memory usage. For further customization, refer to the Cacti documentation.