How to Install Cacti on Debian 9 Stretch
Switch to the root user.
sudo su -
Update the repository index.
Install below packages for cacti installation.
apt-get -y install apache2 php php-mysql php-snmp mariadb-server mariadb-client snmpd rrdtool
Install the cacti package using the apt-get command.
apt-get -y install cacti
Follow the onscreen instruction for setting up Cacti.
Select the web server and press enter to configure the web server for Cacti automatically. By doing this, Cacti eases our web server configuration you do it for accessing Cacti web interface.
In my case, the web server is apache2.
Click Yes to configure a database for cacti or click No to set up a database manually.
Enter the password for Cacti user for cacti database.
Reenter the password.
In Debian 9, you do not need to setup Cacti or go through the series of installation procedure over a web interface.
Open up a browser and visit the below URL.
Login to Cacti using username “admin” and password “admin“.
Reset Cacti admin password (Optional)
I had to reset login password of the user admin as the default password was not working for me. If you are also unable to login to Cacti then follow below steps.
Log in Cacti database with the user cacti and the password you entered during the Cacti installation.
mysql -u root -p cacti
Run the following MySQL query. Replace yourpassword with the password of your choice.
update user_auth set password=md5('yourpassword') where username='admin';
The Cacti Dashboard will look like below after successful login.
Usage graph of a device (localhost):
Now you can add devices to Cacti and monitor its usage. More documentation can be found here.