Cacti is a web based PHP/MySql graphing solution using the RRDtool engine. Classically, it can graph network bandwidthes with SNMP. But in fact, a lot of different graphs can be done with snmp, shell or perl scripts.
Cacti’s strength lies in the fact that it can be installed and used incredibly easily. You don’t need to be a guru or spend tons of hours on the tool to configure it. Even a beginner can use it very quickly. On the very active Cacti forum, you can share “Cacti templates” with other users which can can save you a lot of time. You can very easily add plugins to the Cacti too enabling the possiblility to integrate other free tools like ntop or php weathermap. In our opinion, this is by far the best RRDtool frontend.
For details about how to use Cacti, see the very good Cacti Manual.
RRDtool is a program developed by the Swiss Tobi Oeticker who was already the creator of the famous MRTG. RRDtool is developed using the “C” programming language and it stores the collected data on “.rrd” files.
The number of records in a “.rrd” file never increases, meaning that old records are frequently removed. This implies that one obtains precise figures for recently logged data, whereas figures based on very old data are mean value approximations. By default, you can have daily, weekly, monthy and yearly graphs.
Some of the advantages of RRDtool over MRTG are the following:
- it is much quicker
- it can use negative values
- it can use more than one data source in a graph
- the generated graphes are very customizable
- it can be used by a wide variety of front-ends such as Cacti
- the RRDtool records stored in .rrd files keep the same size and do not increase.
The following programs are needed to run cacti:
- apache2 for the web server
- mysql-server for the database
- php5 for the server-based script
- snmp – snmp tools used to collect data to the remote hosts
- rrdtool – a perl script to format collected data to rrdtool files
- php5-gd – the graphical library used by a Cacti plugin named php weathermap
Use apt-get to install the programs
#apt-get install apache2
#apt-get install mysql-server
#apt-get install php5
#apt-get install php5-common
#apt-get install php5-cgi
#apt-get install php5-cli
#apt-get install php5-mysql
#apt-get install snmp
#apt-get install rrdtool
INSTALL CACTI WITH APT-GET (recommanded)
|#apt-get install cacti|
You will have to configure the mysql settings through a little wizard.
At the end of the tutorial, a mysql database and user named cacti will be automatically created.
Now Cacti is ready to be used via: http://localhost/cacti The default login and password are admin.
Cacti will check if all the required tools are correctly installed.
Initial Cacti Configuration
Select “New Install”
Verify the required tools are correcty seen by cacti
Note that the poller.php script which send the requests to the remote hosts is lauched by the apache2 user, it means www-data.
To reconfigure cacti, use the following command:
If you want to activate the poller manually run:
Sometimes you need to activate it the first time, then it should run automatically every 5 minutes by default.
See also Multi-CPU Utilization Graphing in Cacti.