How to Install Cacti SNMP Monitoring Tool on Debian 9In this guide, we plan to teach you how to install Cacti on a Debian 9 server. Cacti is an open-source, web-based network graphing solution made in PHP and built on top of the industry-standard data logging tool RRDtool. Cacti has all information required in a MySQL database and it allows a user to poll services at a predetermined interval and then graphs the resulting data with RRDtool. This tutorial will work on different Linux VPS systems, too; however, it was made and experimented with on a Debian 9 VPS.
Step 1: Log in to your VPS via SSH
ssh [email protected]_IP
Step 2: Updating the System
sudo apt update && sudo apt -y upgrade
Step 3: Installing the MariaDB ServerNow we are going to install MariaDB 10.1 server from the official Debian repositories. Feel free to skip this step if you have MariaDB/MySQL server installed on your machine already. In order to have MariaDB installed, execute the command below:
sudo apt install mariadb-server mariadb-client
Step 4: Securing the MariaDB installationAfter the MariaDB installation is done, execute the command below so the installation is secure:
Step 5: Enabling Large Varchar IndexesModify your MariaDB/MySQL configuration and enable large varchar indexes:
sudo nano /etc/mysql/mariadb.conf.d/50-server.cn [mysqld] innodb_file_format = Barracuda innodb_file_per_table = 1 innodb_large_prefix character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci skip-character-set-client-handshake
Step 6: Restarting MariaDBNext, we will need to restart the MariaDB service in order for the changes to take effect:
sudo systemctl restart mariadb
Step 7: Install Apache2, PHP, and other needed PHP modules.Odds are that you’ve got Apache and PHP installed already on your machine, but in case you don’t, run the command below:
sudo apt install apache2 php php-mysql php-snmp
Step 8: Installing CactiAfter Apache, PHP, and MariaDB have been installed, we may continue with the Cacti Installation. The simplest way to install Cacti on Debian 9 is to use the Cacti deb package from Debian’s apt repository. The command below should install Cacti and every necessary requirement along with the rrdtool: The command below should install Cacti and every necessary requirement along with the rrdtool:
You will then be asked to answer a couple of questions. Configure database for cacti with dbconfig-common? Choose Yes, then click on [enter] Please provide a password for cacti to register with the database server. If left blank, a random password will be generated. MySQL application password for cacti: Keep it empty and continue with enter: Please select the web server for which Cacti should be automatically configured Select “None” if you would like to configure the web server manually. Choose Apache and hit enter once more. Step 9: Set the Admin Password After the installation is done, set the admin password with the command below:
sudo apt install cacti snmpd
This is all, you should now have Cacti successfully installed on your Debian 9 VPS. You may now log in to the Cacti web interface at http://YOUR_IP/cacti with the username admin and password your_new_admin_password.
mysql -u root -p -D cacti -e "update user_auth set password=md5('your_new_admin_password') where username='admin';"
Updated on 05 Mar 2018
Add a comment