Here is some Background before we get started.
I had originally posted about setting up Cacti on the Raspberry Pi a few posts back. Since there was plenty of on line tutorials, I just made references to sites that have since changed their content. When I returned to the subject recently, I found that the steps were plagued with antiquated commands
Ultimately, I was able to find the compile a list of commands that will help you get Cacti operational with minimal effort. The fundamentals should already be in place. If not, these are the steps:
- Linux – Raspberry Pi with running Operating System
- Apache – Web services for Linux
sudo apt-get install apache2 -y
- MySQL – Database back end for Cacti
sudo apt-get install mysql-server php-mysql -y
- PHP – The scripting language that ties the database to web front end.
sudo apt-get install php libapache2-mod-php -y
- PhpMyAdmin – Useful, but not essential.
sudo apt-get install phpmyadmin sudo nano /etc/apache2/apache2.conf
sudo chown -R www-data:www-data /usr/share/phpmyadmin sudo chown -R www-data:www-data /var/lib/phpmyadmin sudo chown -R www-data:www-data /etc/phpmyadmin sudo apt install php-gettext sudo nano /etc/php/7.0/apache2/php.ini
upload_max_filesize = 200M
post_max_size = 200M
I had done this earlier when setting up the WordPress Sandbox on the Raspberry Pi. So here is the simplified install of Cacti on the Raspberry Pi.
- Cacti Dependencies – these are fundamentals for Cacti to work.
sudo apt-get install mysql-client php-snmp php-gd php-ldap rrdtool snmp snmpd -y
This took a while to install and prompted me to keep my changes to the modified php.ini file I had done in step 5 above. Next was the actual install of Cacti.
- Cacti Installation
sudo apt-get install -y cacti
The install prompts to configure Cacti, I used dbconfig-common to configure my database. Next, I entered the MySQL root password and set my web server option to Apache2. Now Cacti should be accessible from the web link, http://raspberrypiip/cacti. The Cacti Installation Guide should appear.
Press the Next >> button.
Select new install then press next.
The dependencies will be validated and if no errors occur, press Finish.
Login with the username admin and the password admin. You’ll be prompted to change it. Once that is done, you should be in the console view of Cacti, congratulations!