About Cacti
Cacti is a PHP/MySQL front end to rrdtool. It handles the storage of all the information required to create and populate rrdtool graphs. Along with being able to maintain Graphs, Data Sources, and RoundRobin Archives in a DataBase, Cacti handles the data gathering also. There is also SNMP support for those used to creating traffic graphs with MRTG.
You can use Cacti to gather any sort of data or fetch information from SNMP capable hosts.
To manually handle data gathering, you can feed Cacti the Command Line for any external script/command along with any data that the user will need to fill in (IP addresses etc). Cacti will then gather this data in a cron job and populate a MySQL database/the RoundRobin Archives.
Data Sources can also be created, which correspond to actual data on the graph. For instance, if a user wants to graph the ping times to a host, they could create a data source, choosing a script that pings a host and returns its value in milliseconds. After defining options for rrdtool such as how to store the data you will be able to define any additional information that the data input source requires, such as a host to ping in this case. Once a data source is created, it is automatically maintained at 5-minute intervals.
For people who are used to creating traffic graphs in MRTG, this process has become much simpler in Cacti. An SNMP interface allows you to enter SNMP capable hosts and Cacti will display that hosts interfaces, all of which can be graphed with once click from that point.
Once one or more data sources are defined, an rrdtool graph can be created using the data. Cacti allow you to create almost any imaginable rrdtool graph using all of the standard rrdtool graph types and consolidation functions. A color selection area and automatic text padding function also aid in the creation of graphs to make the process easier.
Cacti has a user management system so you can allocate people various levels of access to the program and their own settings.
Cacti Requirements
Cacti require that the following software is installed on your system.
RRDTool 1.0.48 or greater
MySQL 3.23 or greater, 4.0.20d or greater highly recommended for advanced features
PHP 4.1 or greater, 4.3.6 or greater highly recommended for advanced features
What are RRDTOOL and SNMPD?
RRDtool is a round-robin database tool designed to handle time-series data like network bandwidth, temperatures, CPU load etc. The data is stored in the round-robin database so that system storage footprint remains constant over time.
Who provides the data to RRDtool ? In our case , its done by SNMP (The Simple Network Management Protocol). Though the name contains simple , SNMP is not that easy to understand. This is clearly stated in the FAQ of SNMP. http://www.snmp.com/FAQs/snmp-faq-part1.txt
Packages for RPM-based Operating Systems
httpd
php
php-mysql
php-snmp
mysql
mysql-server
net-snmp
Ports for FreeBSD
www/apache2
net/rrdtool
net/net-snmp
www/php4-cgi
lang/php4 (With MySQL and SNMP Support)
databases/mysql323-server
MySQL Configuration for Cacti:
[root:~]# mysql -uroot -p
Enter password:
mysql> create database cactidb;
mysql> grant all on cactidb.* to root;
mysql> grant all on cactidb.* to root@localhost;
mysql> grant all on cactidb.* to cactiuser;
mysql> grant all on cactidb.* to cactiuser@localhost;
mysql> set password for cactiuser@localhost=password(cactipw);
mysql> flush privileges;
mysql> exit
[root:~]#
RRDTool Installation:
[root:~]# cd /usr/local/src/
[root:~]# wget http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/rrdtool.tar.gz
[root:~]# tar -zxf rrdtool.tar.gz
[root:~]# cd rrdtool*
[root:~]# ./configure
[root:~]# make
[root:~]# make install
[root:~]# make site-perl-install
[root:~]# cd ..
[root:~]# rm -fr rrdtool*
[root:~]#
Download and Setup Cacti:
[root:~]# group-add cacti
[root:~]# useradd -g cacti cactiuser
[root:~]# tar -zxvf cacti*
[root:~]# mv cacti-0.8.xx /home/cactiuser/cacti
[root:~]# cd /home/cactiuser/cacti
[root:~]# mysql user=root password=rootpw cactidb < cacti.sql
[root:~]# chown -R cactiuser rra/ log/
Make the proper changes for database and database password:
[root:~]# vi /include/config.php
$database_defaut = cactidb;
$database_hostname = localhost;
$database_username = cactiuser;
$database_password = cactipw
Add this cron in /etc/crontab
*/5 * * * * cactiuser php /home/cactiuser/cacti/poller.php > /dev/null 2>&1
Add an alias or virtual host in your apache configuration file:
Alias /cacti/ /home/cactiuser/cacti/
Save and restart the apache and mysql service.
Post Installation Steps:
Browse the below-mentioned URL:
http://localhost/cacti
-OR-
http://remoteIP/cacti
1. Click Next
2. Default (New Install) -> Click Next
3. In the third step, you will have to provide the correct path of rrdtool and php
RRDTOOL = /usr/local/rrdtool-1.2.15/bin/rrdtool
4. Click Finish
5. Login with Username/Password: admin/admin
6. Change Password for user admin
7. Click Save
That’s all cacti is installed!
Article authored by Dileep
Author, Dileep, is a Systems Engineer with SupportPRO. Dileep specializes in cPanel, Direct Admin and Linux servers. SupportPRO offers 24X7 technical support services to Web hosting companies and service providers.
If you require help, contact SupportPRO Server Admin


