Homepage

Cacti

CentOS 5
yum install rrdtool -y

CentOS 6

yum install rrdtool -y

yum install http*,mysql*,php*,snmp* ,net-snmp-utils

#tar -xvf cacti-0.8.6h.tar.gz

move the uncompressed folder inside your /var/www folder, for example:

#mv /home/po/Desktop/cacti /var/www/
 
Then Configure the Cacti database

#mysqladmin -u root -p create cacti

We now have to insert the Cacti tables inside the cacti database:

mysql -u root -p cacti < /var/www/cacti/sql/cacti.sql

As always, it's better to access the database without the root user.
So, login into the database and create a new MySQL user:

#mysql -u root -p cacti

We give all the rights to the cactiuser on the cacti database:

mysql> grant all on cacti.* to cactiuser@localhost identified by 'cactiuser'; 

Now, reload mysql rights:


mysql>flush privileges;
mysql>exit
We need to change the database connection settings located in the
/var/www/cacti/include/config.php file

$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cactiuser";
$database_port = "3306";
We then need to create a user to run cacti, this user will not be allowed tu run any shell command (/bin/false):


#useradd cacti -d /var/www/cacti/ -s /bin/false

The cacti user we need to write in two folders, so:


#chown -R cacti /var/www/html/cacti/
We will need to do a cron job to run the php script every 5 minutes


#crontab -e -u cacti
*/5 * * * * php5 /var/www/html/cacti/poller.php > /dev/null 2>&1
Restart the apache webserver:


#/etc/init.d/apache2 restart
Finally we can log in to cacti with a web browser:


Use "admin" as the default login and password.

###################Install Plugin Architecture ###################################

***Important Version Compatibility***

cacti_0.8.7g
cacti-plugin-0.8.7g-PA-v2.8
Before doing anything, backup your cacti-root-folder just in case you screwed up while making changes on your system.

1. Download cacti-plugin-arch and extract

#cd /opt
#tar -xzvf cacti-plugin-0.8.7g-PA-v2.8.tar.gz
2. Copy patch file to /var/www and perform patch

#cd cacti-plugin-arch
#cp cacti-plugin-0.8.7g-PA-v2.8.diff /var/www
#cd /var/www/cacti
#patch -p1 -N < /var/www/cacti-plugin-0.8.7g-PA-v2.8.diff
3. Edit include/config.php, and change database credentials

#vi /var/www/cacti/include/config.php

Update "url_path"

$url_path = "/cacti/";
4. Configure Plugin Architecture

- login to Cacti
- User Management > Admin > Realm Permission
- "check" the Plugin Management
- Done


==================================================================================
Installation
1/ Go to your plugins cacti installation
Code:
cd cacti/plugins/
2/ Get the plugin attached to the post : http://forums.cacti.net/download.php?id=13431
3/ Extract him
Code:
tar xzf realtime.tar.gz
cd ..

4/ Add plugin to your config by adding this to your include/config.php :
Code:
$plugins[] = 'realtime';
5/ Goto Settings->Misc and configure the cache directory and other settings.
6/ Make sure that web user can write to the cache directory :
Code:
chmod a+wx /var/www/html/cacti/rcache

 

 
 

#vim /etc/httpd/conf.d/cacti.conf
  • Apache
# vi /etc/httpd/conf.d/cacti.conf
 Alias /cacti    /usr/share/cacti
<Directory /usr/share/cacti/>
         <IfModule mod_authz_core.c>
                 # httpd 2.4                
Require host localhost
         </IfModule>
         <IfModule !mod_authz_core.c>
                 # httpd 2.2
                 Order deny,allow
                 Deny from all
                 Allow from all
         </IfModule>
</Directory>

No comments:

Post a Comment