Cacti is an open-source web-based network monitoring and system monitoring graphing tool. It is a frontend to RRDTool - a Time Series Database (TSDB).
Using Cacti you can monitor servers and network devices such as servers, routers, and switches. It gathers and monitors network traffic using the SNMP protocol. It can monitor various system metrics such as CPU, memory disk space, and bandwidth utilization among others. You can also set up alerts so that you receive email notifications in the event of a system outage. Furthermore, it enables a faster response time when a problem arises.
You can use LAMP stack to install Cacti on Linux Distribution. It also supports Nginx and IIS Webserver. The data collected is then stored in a MySQL or MariaDB database. The Data Collection framework is fully distributed, fault-tolerant and scalable.
In this guide, we will go through how to install and configure Cacti on Ubuntu 20.04.
Step 1: Install Apache webserver
Start off by updating your system packages with the following command:
sudo apt update -y
Cacti Monitoring tool is accessed via a web browser and we need to set up a web server. We will install the Apache2 webserver.
Cacti stores all the data gathered from network devices in a database. In this guide, we will install MariaDB which is a robust open-source relational database, forked from MySQL.
MariaDB is available in the Ubuntu 20.04 repository. Simply install MariaDB with the following command:
sudo apt install mariadb-server mariadb-client
For Cacti to perform optimally, we need to tune the MariaDB database server. Access the 50-server.cnf configuration file.
sudo vim /etc/mysql/mariadb.conf.d/50-server.cnf
Below the [ mysqld ] section, append the following lines:
Next, adjust the max_execution time and memory limit and set your preferred timezone on /etc/php/7.4/apache2/php.ini and /etc/php/7.4/cli/php.ini files.
Now edit the Cacti configuration file. Open the config.php file.
sudo vim /var/www/html/cacti/include/config.php
Then, update the database details in the configuration file. Change the details to reflect the values you set when creating the database in Step 5 above.
In this step, we create a new virtual host file for the Cacti site.
sudo vim /etc/apache2/sites-available/cacti.conf
Add the following lines
Alias /cacti /var/www/html/cacti
<Directory /var/www/html/cacti/>
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</Directory>
Save and exit. Restart Apache for the changes to be applied
sudo systemctl restart apache2
Great. the only thing remaining now is to wind up with Cacti set up on a browser.
Step 9: Setting Up Cacti on a browser
We have completed all of the Cacti configurations at this time. Now we have to finish the Cacti installation in a web browser. The Cacti setup wizard will lead you through the process step by step. Access cacti using the following address:
http://server-ip-address/cacti
A login page will be displayed as shown below. Login with the default credentials:
Username: admin
Password: admin
Next, you will be prompted to reset your password. Make sure you set a strong password for security reasons and click on the 'Save' button.
Next, agree to the GPL license in the checkbox. Click on ‘Begin’ to continue with the installation.
Cacti will then run pre-installation checks to ensure that your system has the necessary PHP modules and database settings for cacti to function properly. If all the configurations are in order, click 'Next.'
Next, select the 'New Primary Server' installation option and double-check that the local database connection parameters are correct before proceeding. Click Next.
BE sure to check that the directory permission checks are correct, then click 'Next.' If not, return to Step 6 and set the permissions as directed.
Next, ensure that the critical binary paths and versions details displayed are correct and click ‘Next'.
In the next step, an overview of input validation whitelist protection is displayed. It suggests a couple of steps to take in order to whitelist data input methods. Check the 'I have read this statement' box to proceed with the installation.
The next step lets you select the data source profiles for polling sources. You can also change the network range to correspond to your subnet.
Cacti provides templates for monitoring and graphing a variety of devices such as routers, Linux, and Windows servers. By default, all settings are checked to ensure that you get all of the templates you require. Click ‘Next’ to proceed.
Next, the installer will verify if the server and database collation is UTF8 compliant. Click ‘Next’.
Next, check the ‘Confirm installation’ box and click the ‘Install’ button to kick off the installation process.
The installation gets underway and should take around a minute to complete.
If the installation is successfully completed, the following screen will be displayed.
Click on the ‘Get started' button. Cacti is now up and running. The Cacti dashboard is displayed as shown below:
Conclusion
You have now successfully installed and configured Cacti on Ubuntu 20.04. You can now start adding your devices and monitoring them.
If this resource helped you, let us know your care by a Thanks Tweet.
Did you find this article helpful?
We are glad you liked the article. Share with your friends.
About The Author
Winnie Ondara
Winnie is a Linux technical writer with over 3 years of experience with various Linux distributions and writing technical guides in Linux. She is passionate about FOSS technologies and always endeavor to learn new technologies. During my free time, I watch movies, listen to music, and catch up with tech news.
Comments