Friday, February 10, 2012

Install cacti

First, make sure EPEL repo is enabled. Type the following command to install cacti:
# yum install cacti
Install cacti tables

Type the following command to find out cacti.sql path:
# rpm -ql cacti | grep cacti.sql
Sample output:


Type the following command to install cacti tables (you need to type the cacti user password):
# mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.7d/cacti.sql

Configure cacti Open /etc/cacti/db.php file, enter:
# vi /etc/cacti/db.php Make changes as follows: /* make sure these values refect your actual database/host/user/password */

$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "zYn95ph43zYtq";
$database_port = "3306";

Save and close the file.
Configure httpd Open /etc/httpd/conf.d/cacti.conf file, enter:

# vi /etc/httpd/conf.d/cacti.conf

You need to update allow from line. Either set to ALL or your LAN subnet to allow access to cacti:

# # Cacti: An rrd based graphing tool # Alias /cacti /usr/share/cacti
Order Deny,Allow
Deny from all
Allow from

Another option is create /usr/share/cacti/.htaccess file and password protect the directory. Finally, restart httpd:
# service httpd restart
Setup cacti cronjob

Open /etc/cron.d/cacti file, enter:
# vi /etc/cron.d/cacti
Uncomment the line:

*/5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1

Save and close the file.
Run cacti installer

Now cacti is ready to install. Fire a webbrowser and type the url:

No comments:

Post a Comment