Join My Community at MyBloglog!

31/07/09

Cacti Instalation and Configuration

Apa itu Cacti??
Cacti is a frontend of RRDTool that store information into the MySQL database and create a graph based on that information. Process data (via SNMP or a script), to the making of the picture (graph) is done using the programming language PHP.

http://www.raxnet.net/products/cacti

Installation:

Cacti need the following applications installed into the system before.

*
RRDtool
*
net-SNMP
*
PHP
*
MySQL

some php module to support SNMP must also be installed.

Download the latest tarball on the Cacti website above, a user cacti: cacti, extract the tarball,

$ sudo mkdir /var/www/html/cacti
$ sudo tar xzf cacti-0.8.6g.tar.gz -C /var/www/html/cacti

first need to create a database to store data generated through surveys into the MySQL database, the database structure has been put into the file cacti.sql,

$ mysqladmin -u root -p create cacti
$ mysql -u root cacti <> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'password';
mysql> flush privileges;

modifications to the file include / config.php, and change some of the following variables:

$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$databse_password = "password";

$ sudo chown -R cacti:cacti /var/www/html/cacti/{rra,log}

cacti crontab edit user, add an entry

$ sudo crontab -e -u cacti
*/5 * * * * /usr/bin/php /var/www/html/cacti/cmd.php


Configure cacti via web-browser on
http://hostname/cacti
Configuration: Login to the admin user, change the admin user password.
Outline of the configuration from the start to the polls for graphing single-host via SNMP are as follows:

create devices:

*
On the tab "Console", click on the link "Create Device"
*
Click on the link "Add" (link on top right)
*
Fill in the required information, click on "Create"

Note:
* Hostname IP number can be charged or fqdn of the host
* Template, when the device that will use SNMP polling in the net-SNMP, select the "ucd / net SNMP host", in addition select "Generic SNMP-enabled host"
* SNMP version, use version 2 for a net-SNMP

*
In the form "Associated Data Queries" check whether the query is successfully produced some of the data, if not successful, check whether the SNMP polling _memang_ to host the dituju can be done, click "Verbose Query" to perform debugging.

*
In the form "Associated Graph Templates" add a few elements that need to be made to its graph (in the pulldown menu, select and click "Add")

*
On the "Devices" there is a link akan host the newly configured, select the link, and make its graph by clicking "Create Graph for this host" (top right)

*
In the form "Graph Templates" and "Data Query" select (checkbox) that need to be made to its graph, click "Create"

*
Next form "Graph template from host" will appear, as necessary modifications, click create


graph trees

*
Graph trees are used to put a graph is created by Cacti, from this tree hierarchy can be created that will facilitate more organizing graph.

*
On the tab "Console", select the link "Graph Trees", graph can be categorized into several categories, such as using a function based on the trees, for example: a category tree to "Server" or "Routers and Switches," under the tree later this graph from every - each host that will be placed

*
To add a tree, click on the link "Add", or when the graph produced by a host entry in the category tree, click the link on the category.

It is recommended to create categories based on the function of the host will be made

graph management

*
To display the resulting graph, graph is to enter into the trees that have been made, click the "Graph Management", in the form will show some data that was collected and its graph can be displayed, to do filtering so that only a particular host that is displayed (if its many data sources), in the pulldown menu (or field), select the desired host.
*
Select (checkbox), and in the pulldown menu "Choose an action", select "Place on a Tree (CATEGORY)". Go
*
Place the graph is under the hostname that has been made in the previous menu "Graph Trees"

Backup:

To membackup RRA (Round Robin Archive) database and cacti

$ Mysqldump-u cacti-p cacti> / backup / cacti-backup.sql
$ Sudo tar-czvf / backup / cacti-backup.tar.gz / var / www / html / cacti / rra (, log, include / config.php)
$ Sudo crontab-u cacti-l> / backup / cacti-backup.crontab

Restore:

To restore the

$ Mysqladmin-u root-p create cacti
$ Mysql-u cacti-p cacti GRANT ALL ON cacti .* to cacti @ localhost identified BY 'password';
mysql> flush privileges;

$ Cd / backup & & sudo tar-xzpvf cacti-backup.tar.gz
$ Sudo mv var / www / html / cacti / rra / * / var / www / html / cacti / rra /
$ Sudo mv var / www / html / cacti / log / * / var / www / html / cacti / log /
$ Sudo mv var / www / html / cacti / include / config.php / var / www / html / cacti / include /

$ Sudo crontab-u cacti / backups / cacti-backup.crontab

And check back in the owner rra / and log / user owned by cacti