You need a LAMP Stack to get cacti working on an Ubuntu server, get the server ready with all the updates and upgrades
apt-get update
apt-get upgrade
Cacti requires MySQL version 5.6 and to get it from the archives add the following custom repository:
add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty universe'
apt-get update
Now install the required packages:
apt-get install apache2 mysql-server-5.6 php libapache2-mod-php
During the installation process you will be asked to add a root password for the mysql and you can set it and press OK . This is not mandatory
To get the Cacti functional we need some more packages :
apt-get install snmp snmpd rrdtool
Now we can install the cacti package as we have completed all the required dependencies :
apt-get install cacti cacti-spine
You will be asked to choose the installed webserver , so the installation will auto configure it for you :
You will also be asked to set a password for cacti db
choose the default connection type:
Then you will also be asked to set a db user for cacti
Now start all the services:
service snmpd restart
service mysql restart
service apache2 restart
So if all the services are running , you can finish the installation from the web URL
http://Your server IP /cacti
Configuring Cacti is very straight forward as it already has a number of Graph templates which you can use out of the box.
So Login to cacti and click on devices and click on the ‘+’ button at the top right .
Then you will be asked to add the details about your remote device :
In my example all my remote machines are Linux servers , but you can configure it for whatever devices for remote polling .
So you can use most of the default settings but make sure you choose the correct SNMP version as on your remote device . Also the SNMP community is mostly ‘Public’ which you can verify it from snmp conf:
/etc/snmp/snmpd.conf
If your remote machines are configured with specific SNMP community you need to use the same in the device config . For eg : most of the production Firewalls has specific SNMP groups for security reasons .
You can choose one of the device templates as below :
These templates are customizable . You can go to Templates >> Device option on the left side of the GUI and choose the selected template . By default , it has lots of parameters ready for polling ,you can delete the unwanted ones :
So back to the device configuration , you can choose the associated data queries . Its a drop down box and you can choose ‘Interface statistics’. You need this if you are tracking specific the interface traffic .
Select the inteface statistics and ‘Add’ and ‘Save’
If your conneection succeeds , at the very top of the page you will see the SNMP connection information . You can then choose ‘Create Graphs for the device’ option at the top :
So the Graph template is already customized with the required paramerts you can tick all the boxes .
Also from SNMP-Inteface statistics , choose the interfaces you need to poll
You can the go back to the devices and list graphs , please note it might take few minutes to get the data updated depends upon the polling interval set at configuration >> settings . So start troublehsooting only after giving it few minutes .
Leave a Reply