Cacti
2
About Cacti
About Cacti
Cacti is a complete network graphing solution designed to harness the power of RRDTool's data storage and graphing functionality.
Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the
box.
All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex networks with
Screen Shot
4
What is Cacti?
What is Cacti?
Cacti is a complete frontend to RRDTool, it stores all of the necessary information to
create graphs and populate them with data in a MySQL database.
The frontend is completely PHP driven. Along with being able to maintain Graphs, Data
Data Sources
Data Sources
To handle data gathering, you can feed cacti the paths to any external script/command
along with any data that the user will need to "fill in", cacti will then gather this data in a
cron-job and populate a MySQL database/the round robin archives.
6
Data Sources
Data Sources
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
Graphs
Graphs
Once one or more data sources are defined, an RRDTool graph can be created using the data.
Cacti allows you to create almost any
imaginable RRDTool graph using all of the standard RRDTool graph types and
consolidation functions.
8
Graphs
Graphs
Not only can you create RRDTool based graphs in cacti, but there are many ways to display them.
Along with a standard "list view" and a "preview mode", which resembles the
RRDTool frontend 4 all, there is a "tree view", which allows you to put graphs onto a
User Management
User Management
Due to the many functions of cacti, a user
based management tool is built in so you can add users and give them rights to certain
areas of cacti.
This would allow someone to create some users that can change graph parameters,
while others can only view graphs. Each user also maintains their own settings when it
10
Features - Graphs
Features - Graphs
Unlimited number of graph items can be defined for each graph optionally utilizing CDEFs or data sources from within cacti.
Automatic grouping of GPRINT graph items to AREA, STACK, and LINE[1-3] to allow for quick re-sequencing of graph items.
Cacti Scripts
Cacti Scripts
Best Post - Complete List of Cacti Scripts and Templates
12
Data Sources
Data Sources
Data sources can be created that utilize
RRDTool's "create" and "update" functions. Each data source can be used to gather local or remote data and placed on a graph.
Supports RRD files with more than one data source and can use an RRD file stored
anywhere on the local file system.
Round robin archive (RRA) settings can be customized giving the user the ability to
Installation
Installation
Cacti requires that the following software : Part of RedHat Distribution :
MySQL 4.1.x or 5.x or greater PHP 4.3.6 or greater
A Web Server e.g. Apache or IIS Free Download:
14
About RRDtool
About RRDtool
RRDtool is the OpenSource industry
standard, high performance data logging and graphing system for time series data.
http://oss.oetiker.ch/rrdtool/
16
Start httpd & mysql
Start httpd & mysql
chkconfig httpd on
chkconfig --list|grep -i http
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
service httpd start servive httpd status chkconfig mysqld
chkconfig --list|grep -i sql
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Configure MySQL
Configure MySQL
Set a password for the root user
shell> mysqladmin --user=root password somepassword
18
Install and Configure Cacti
Install and Configure Cacti
Download software (free)Extract the distribution tarball. cd /var/www/html
tar xzvf cacti-version.tar.gz mv cacti-version cacti
cd cacti
Create the MySQL database:
Mysql Configuration
Mysql Configuration
shell>mysql -u root -ppassword mysql>show databases;
mysql>use cacti; mysql>show tables;
shell>cat cacti.sql | mysql -u root -ppassword -D cacti
mysql>GRANT ALL ON cacti.* TO
20
Configure php
Configure php
Edit include/config.php and specify the database type, name, host, user and password for your Cacti configuration. $database_type = "mysql";
$database_default = "cacti";
Crontab
Crontab
Add a line to your /etc/crontab file similar to: */5 * * * * php /var/www/html/cacti/poller.php
> /dev/null 2>& 1
Point your web browser to:
http://your-server/cacti/
Log in the with a username/password of
admin. You will be required to change this
22
Add new graph
Add new graph
http://www.cacti.net/downloads/docs/html/how_to.html
The minimal steps to create a graph from a script are simply:
Create a Data Input Method to tell Cacti how to call the script and what to expect from it.
Create a Data Source to tell cacti how and where the data will be stored.
Create a Graph to tell cacti how the data will be presented in graph form.
24