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.
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
1 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.
MySql root user password
New MySql cacti user password
Confirm MySql cacti user password
Web server used by cacti
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.
Select “upgrade” or “new install”
Check if 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:
Sometime you need to activate it the first time, then it runs automatically every 5 minutes by default.
For more details about how to use Cacti, a very good Cacti Manual.