Pages

Unixbhaskar's Blog

Tuesday, May 10, 2011

Cacti implementation on CentOS AMI

In this article I will show you some graphing solution through RRD tool along with Cacti.I can tell you it require lot of work to get thing going with Cacti for graphing.

So here we go:

For cacti installation on RHEL or CentOS we need below package to be installed in the system:

httpd
php
php-mysql
php-snmp
php-ldap (when using LDAP authentication)
php-xml
mysql
mysql-server
net-snmp (depending on the distro, net-snmp-utils may be required)


Step 1:

Fetch cacti from cacti.net

[bhaskar@Amazon-instances ~]$ wget -c http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz
-2011-04-29 02:18:20- http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz
Resolving www.cacti.net... 140.211.167.231, 173.225.179.10, 209.242.232.5
Connecting to www.cacti.net... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2236916 (2.1M) [application/x-gzip]
Saving to: `cacti-0.8.7g.tar.gz'

100%[===================================================================================>] 2,236,916 1.34M/s in 1.6s

2011-04-29 02:18:22 (1.34 MB/s) - `cacti-0.8.7g.tar.gz' saved [2236916/2236916]


Step 2:

Get the required software in the box:

[bhaskar@Amazon-instances ~]$ sudo yum install httpd php php-mysql php-snmp php-xml mysql mysql-server net-snmp

addons | 951 B 00:00
base | 2.1 kB 00:00
centosplus | 1.9 kB 00:00
epel | 3.7 kB 00:00
epel/primary_db | 3.7 MB 00:00
extras | 2.1 kB 00:00
rightscale-epel | 951 B 00:00
rightscale-epel/primary | 34 kB 00:00
rightscale-epel 118/118
updates | 1.9 kB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.2.3-31.el5.centos.4 set to be updated
addons/filelists | 196 B 00:00
base/filelists_db | 3.9 MB 00:00
centosplus/filelists_db | 2.2 MB 00:00
epel/filelists_db | 5.2 MB 00:00
extras/filelists_db | 212 kB 00:00
rightscale-epel/filelists | 36 kB 00:00
updates/filelists_db | 2.9 MB 00:00
---> Package mysql.i386 0:5.0.77-4.el5_4.2 set to be updated
--> Processing Dependency: perl(DBI) for package: mysql
---> Package mysql.x86_64 0:5.0.77-4.el5_4.2 set to be updated
---> Package mysql-server.x86_64 0:5.0.77-4.el5_4.2 set to be updated
--> Processing Dependency: perl-DBD-MySQL for package: mysql-server
---> Package net-snmp.x86_64 1:5.3.2.2-7.el5_4.2 set to be updated
--> Processing Dependency: net-snmp-libs = 1:5.3.2.2-7.el5_4.2 for package: net-snmp
--> Processing Dependency: libnetsnmpmibs.so.10()(64bit) for package: net-snmp
--> Processing Dependency: libnetsnmptrapd.so.10()(64bit) for package: net-snmp
--> Processing Dependency: libnetsnmpagent.so.10()(64bit) for package: net-snmp
--> Processing Dependency: libnetsnmp.so.10()(64bit) for package: net-snmp
--> Processing Dependency: libsensors.so.3()(64bit) for package: net-snmp
--> Processing Dependency: libnetsnmphelpers.so.10()(64bit) for package: net-snmp
---> Package php.x86_64 0:5.2.4-RightScale set to be updated
--> Processing Dependency: php-cli = 5.2.4-RightScale for package: php
--> Processing Dependency: php-common = 5.2.4-RightScale for package: php
---> Package php-mysql.x86_64 0:5.2.4-RightScale set to be updated
--> Processing Dependency: php-pdo for package: php-mysql
---> Package php-snmp.x86_64 0:5.2.4-RightScale set to be updated
---> Package php-xml.x86_64 0:5.2.4-RightScale set to be updated
--> Processing Dependency: libexslt.so.0()(64bit) for package: php-xml
--> Processing Dependency: libxslt.so.1()(64bit) for package: php-xml
--> Running transaction check
---> Package libxslt.x86_64 0:1.1.17-2.el5_2.2 set to be updated
---> Package lm_sensors.x86_64 0:2.10.7-4.el5 set to be updated
---> Package net-snmp-libs.x86_64 1:5.3.2.2-7.el5_4.2 set to be updated
---> Package perl-DBD-MySQL.x86_64 0:3.0007-2.el5 set to be updated
---> Package perl-DBI.x86_64 0:1.52-2.el5 set to be updated
---> Package php-cli.x86_64 0:5.2.4-RightScale set to be updated
---> Package php-common.x86_64 0:5.2.4-RightScale set to be updated
---> Package php-pdo.x86_64 0:5.2.4-RightScale set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================
Installing:
httpd x86_64 2.2.3-31.el5.centos.4 updates 1.2 M
mysql i386 5.0.77-4.el5_4.2 updates 4.8 M
mysql x86_64 5.0.77-4.el5_4.2 updates 4.8 M
mysql-server x86_64 5.0.77-4.el5_4.2 updates 9.8 M
net-snmp x86_64 1:5.3.2.2-7.el5_4.2 updates 701 k
php x86_64 5.2.4-RightScale rightscale-epel 3.9 M
php-mysql x86_64 5.2.4-RightScale rightscale-epel 277 k
php-snmp x86_64 5.2.4-RightScale rightscale-epel 44 k
php-xml x86_64 5.2.4-RightScale rightscale-epel 328 k
Installing for dependencies:
libxslt x86_64 1.1.17-2.el5_2.2 base 488 k
lm_sensors x86_64 2.10.7-4.el5 base 527 k
net-snmp-libs x86_64 1:5.3.2.2-7.el5_4.2 updates 1.3 M
perl-DBD-MySQL x86_64 3.0007-2.el5 base 148 k
perl-DBI x86_64 1.52-2.el5 base 600 k
php-cli x86_64 5.2.4-RightScale rightscale-epel 2.7 M
php-common x86_64 5.2.4-RightScale rightscale-epel 365 k
php-pdo x86_64 5.2.4-RightScale rightscale-epel 163 k

Transaction Summary
=============================================================================================================================
Install 17 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 32 M
Is this ok [y/N]:y

Downloading Packages:
(1/17): php-snmp-5.2.4-RightScale.x86_64.rpm | 44 kB 00:00
(2/17): perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm | 148 kB 00:00
(3/17): php-pdo-5.2.4-RightScale.x86_64.rpm | 163 kB 00:00
(4/17): php-mysql-5.2.4-RightScale.x86_64.rpm | 277 kB 00:00
(5/17): php-xml-5.2.4-RightScale.x86_64.rpm | 328 kB 00:00
(6/17): php-common-5.2.4-RightScale.x86_64.rpm | 365 kB 00:00
(7/17): libxslt-1.1.17-2.el5_2.2.x86_64.rpm | 488 kB 00:00
(8/17): lm_sensors-2.10.7-4.el5.x86_64.rpm | 527 kB 00:00
(9/17): perl-DBI-1.52-2.el5.x86_64.rpm | 600 kB 00:00
(10/17): net-snmp-5.3.2.2-7.el5_4.2.x86_64.rpm | 701 kB 00:00
(11/17): httpd-2.2.3-31.el5.centos.4.x86_64.rpm | 1.2 MB 00:00
(12/17): net-snmp-libs-5.3.2.2-7.el5_4.2.x86_64.rpm | 1.3 MB 00:00
(13/17): php-cli-5.2.4-RightScale.x86_64.rpm | 2.7 MB 00:00
(14/17): php-5.2.4-RightScale.x86_64.rpm | 3.9 MB 00:00
(15/17): mysql-5.0.77-4.el5_4.2.i386.rpm | 4.8 MB 00:00
(16/17): mysql-5.0.77-4.el5_4.2.x86_64.rpm | 4.8 MB 00:00
(17/17): mysql-server-5.0.77-4.el5_4.2.x86_64.rpm | 9.8 MB 00:00
-----------------------------------------------------------------------------------------------------------------------------
Total 20 MB/s | 32 MB 00:01
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php-common 1/17
Installing : perl-DBI 2/17
Installing : mysql 3/17
Installing : net-snmp-libs 4/17
Installing : perl-DBD-MySQL 5/17
Installing : php-cli 6/17
Installing : php-pdo 7/17
Installing : httpd 8/17
warning: /etc/rc.d/init.d/httpd saved as /etc/rc.d/init.d/httpd.rpmorig
Installing : lm_sensors 9/17
Installing : net-snmp 10/17
Installing : libxslt 11/17
Installing : mysql 12/17
Installing : php-mysql 13/17
Installing : php-xml 14/17
Installing : php 15/17
Installing : php-snmp 16/17
Installing : mysql-server 17/17

Installed:
httpd.x86_64 0:2.2.3-31.el5.centos.4 mysql.i386 0:5.0.77-4.el5_4.2 mysql.x86_64 0:5.0.77-4.el5_4.2
mysql-server.x86_64 0:5.0.77-4.el5_4.2 net-snmp.x86_64 1:5.3.2.2-7.el5_4.2 php.x86_64 0:5.2.4-RightScale
php-mysql.x86_64 0:5.2.4-RightScale php-snmp.x86_64 0:5.2.4-RightScale php-xml.x86_64 0:5.2.4-RightScale

Dependency Installed:
libxslt.x86_64 0:1.1.17-2.el5_2.2 lm_sensors.x86_64 0:2.10.7-4.el5 net-snmp-libs.x86_64 1:5.3.2.2-7.el5_4.2
perl-DBD-MySQL.x86_64 0:3.0007-2.el5 perl-DBI.x86_64 0:1.52-2.el5 php-cli.x86_64 0:5.2.4-RightScale
php-common.x86_64 0:5.2.4-RightScale php-pdo.x86_64 0:5.2.4-RightScale

Complete!

Step 3:
Now unzipping the tarball we downloaded from the cacti site:

[bhaskar@Amazon-instances ~]$ tar -xvzf cacti-0.8.7g.tar.gz

[bhaskar@Amazon-instances ~]$ ls
cacti-0.8.7g cacti-0.8.7g.tar.gz


Step 4:

Move the cacti dir to short and convinient name

[bhaskar@Amazon-instances ~]$ mv cacti-0.8.7g cacti

[bhaskar@Amazon-instances ~]$ ls
cacti cacti-0.8.7g.tar.gz


Step 5:

Now move the cacti dir to the document root of the system:

[bhaskar@Amazon-instances ~]$ sudo mv -v cacti /var/www/html/
`cacti' -> `/var/www/html/cacti'


Step 6:

Addming Cacti group and user in the box:

[bhaskar@Amazon-instances ~]$ sudo /usr/sbin/groupadd cacti

Adding users for cacti:

[bhaskar@Amazon-instances ~]$ sudo /usr/sbin/useradd -g cacti amazoncacti

Adding password to the user:

[bhaskar@Amazon-instances ~]$ sudo /usr/bin/passwd amazoncacti
Changing password for user amazoncacti.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.



Step 7:

Chnage the ownership of few dir in the cacti base dir:

[bhaskar@Amazon-instances cacti]$ sudo /bin/chown -R amazoncacti rra/ log/

[bhaskar@Amazon-instances cacti]$ ls -ld rra log
drwxr-xr-x 2 amazoncacti bhaskar 4096 Dec 30 2009 log
drwxr-xr-x 2 amazoncacti bhaskar 4096 May 16 2010 rra


Step 8:

MySql admin password creation:

[bhaskar@Amazon-instances cacti]$ sudo /usr/bin/mysqladmin -u root password somethingsensible

Step 9:

Create Cacti database for use:

[bhaskar@Amazon-instances cacti]$ sudo /usr/bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create database cacti;
Query OK, 1 row affected (0.00 sec)


Step 10:

Sourcing the default sql file into cacti database like below:

mysql> source cacti.sql

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec

output snipped for the sake of bravity!!!

Step 11:

Now time to grant some priviledge to the cacti user to get into the database and fetch thing from it. From the mysql shell do follow:

mysql> GRANT ALL ON cacti.* TO amazoncacti@localhost IDENTIFIED BY 'somethingsensible';
Query OK, 0 rows affected (0.00 sec)

Refreshing the grant table:

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)


Step 12:

Now time for edit some files within cacti directory..

[bhaskar@Amazon-instances cacti]$ sudo vim include/config.php

Here it looks like inside... and I have change the database username and password entry in it:

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



Step 13:

I am creating a cron job to polls for the infomration:

[root@Amazon-instances cacti]# crontab -e

[root@Amazon-instances cacti]# crontab -l
*/5 * * * * amazoncacti /usr/bin/php /var/www/html/cacti/poller.php > /dev/null 2>&1


Step 14:

Some php tweaking for the betterment:

[root@Amazon-instances cacti]# sudo vim /etc/php.ini

In this file I have changed memory_limit variable 32M to 128M

Step 15:

Now we need to got to the web interface of it,by pressing the following url into the browser:

http://Amazon-instances.amazonaws.com/cacti/

Step 16:

Snmpwalk not found by the cacti installer so go ahead and installed more binaries:

[root@Amazon-instances ~]# yum install net-snmp-utils net-snmp-devel
addons | 951 B 00:00
base | 2.1 kB 00:00
centosplus | 1.9 kB 00:00
epel | 3.7 kB 00:00
extras | 2.1 kB 00:00
rightscale-epel | 951 B 00:00
updates | 1.9 kB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package net-snmp-devel.i386 1:5.3.2.2-7.el5_4.2 set to be updated
--> Processing Dependency: libnetsnmpagent.so.10 for package: net-snmp-devel
--> Processing Dependency: libnetsnmptrapd.so.10 for package: net-snmp-devel
--> Processing Dependency: elfutils-devel for package: net-snmp-devel
--> Processing Dependency: elfutils-libelf-devel for package: net-snmp-devel
--> Processing Dependency: libnetsnmpmibs.so.10 for package: net-snmp-devel
--> Processing Dependency: libsnmp.so.10 for package: net-snmp-devel
--> Processing Dependency: libnetsnmphelpers.so.10 for package: net-snmp-devel
--> Processing Dependency: libnetsnmp.so.10 for package: net-snmp-devel
--> Processing Dependency: rpm-devel for package: net-snmp-devel
--> Processing Dependency: lm_sensors-devel for package: net-snmp-devel
--> Processing Dependency: beecrypt-devel for package: net-snmp-devel
---> Package net-snmp-devel.x86_64 1:5.3.2.2-7.el5_4.2 set to be updated
---> Package net-snmp-utils.x86_64 1:5.3.2.2-7.el5_4.2 set to be updated
--> Running transaction check
---> Package beecrypt-devel.x86_64 0:4.1.2-10.1.1 set to be updated
--> Processing Dependency: beecrypt = 4.1.2-10.1.1 for package: beecrypt-devel
--> Processing Dependency: libbeecrypt.so.6()(64bit) for package: beecrypt-devel
---> Package elfutils-devel.x86_64 0:0.137-3.el5 set to be updated
--> Processing Dependency: elfutils-devel-static-x86_64 = 0.137-3.el5 for package: elfutils-devel
---> Package elfutils-libelf-devel.x86_64 0:0.137-3.el5 set to be updated
--> Processing Dependency: elfutils-libelf-devel-static-x86_64 = 0.137-3.el5 for package: elfutils-libelf-devel
---> Package lm_sensors-devel.x86_64 0:2.10.7-4.el5 set to be updated
---> Package net-snmp-libs.i386 1:5.3.2.2-7.el5_4.2 set to be updated
---> Package rpm-devel.x86_64 0:4.4.2.3-18.el5 set to be updated
--> Processing Dependency: sqlite-devel for package: rpm-devel
--> Processing Dependency: libselinux-devel for package: rpm-devel
--> Processing Dependency: nss-devel for package: rpm-devel
--> Running transaction check
---> Package beecrypt.x86_64 0:4.1.2-10.1.1 set to be updated
---> Package elfutils-devel-static.x86_64 0:0.137-3.el5 set to be updated
---> Package elfutils-libelf-devel-static.x86_64 0:0.137-3.el5 set to be updated
---> Package libselinux-devel.x86_64 0:1.33.4-5.5.el5 set to be updated
--> Processing Dependency: libsepol-devel >= 1.15.2-1 for package: libselinux-devel
---> Package nss-devel.x86_64 0:3.12.6-1.el5.centos set to be updated
--> Processing Dependency: nspr-devel >= 4.8.4 for package: nss-devel
---> Package sqlite-devel.x86_64 0:3.3.6-5 set to be updated
--> Running transaction check
---> Package libsepol-devel.x86_64 0:1.15.2-2.el5 set to be updated
---> Package nspr-devel.x86_64 0:4.8.4-1.el5_4 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================
Installing:
net-snmp-devel i386 1:5.3.2.2-7.el5_4.2 updates 1.9 M
net-snmp-devel x86_64 1:5.3.2.2-7.el5_4.2 updates 2.0 M
net-snmp-utils x86_64 1:5.3.2.2-7.el5_4.2 updates 187 k
Installing for dependencies:
beecrypt x86_64 4.1.2-10.1.1 base 87 k
beecrypt-devel x86_64 4.1.2-10.1.1 base 118 k
elfutils-devel x86_64 0.137-3.el5 base 62 k
elfutils-devel-static x86_64 0.137-3.el5 base 119 k
elfutils-libelf-devel x86_64 0.137-3.el5 base 24 k
elfutils-libelf-devel-static x86_64 0.137-3.el5 base 64 k
libselinux-devel x86_64 1.33.4-5.5.el5 base 149 k
libsepol-devel x86_64 1.15.2-2.el5 base 192 k
lm_sensors-devel x86_64 2.10.7-4.el5 base 81 k
net-snmp-libs i386 1:5.3.2.2-7.el5_4.2 updates 1.3 M
nspr-devel x86_64 4.8.4-1.el5_4 updates 111 k
nss-devel x86_64 3.12.6-1.el5.centos updates 233 k
rpm-devel x86_64 4.4.2.3-18.el5 base 1.3 M
sqlite-devel x86_64 3.3.6-5 base 257 k

Transaction Summary
=============================================================================================================================
Install 17 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 8.0 M
Is this ok [y/N]:y

Downloading Packages:
(1/17): elfutils-libelf-devel-0.137-3.el5.x86_64.rpm | 24 kB 00:00
(2/17): elfutils-devel-0.137-3.el5.x86_64.rpm | 62 kB 00:00
(3/17): elfutils-libelf-devel-static-0.137-3.el5.x86_64.rpm | 64 kB 00:00
(4/17): lm_sensors-devel-2.10.7-4.el5.x86_64.rpm | 81 kB 00:00
(5/17): beecrypt-4.1.2-10.1.1.x86_64.rpm | 87 kB 00:00
(6/17): nspr-devel-4.8.4-1.el5_4.x86_64.rpm | 111 kB 00:00
(7/17): beecrypt-devel-4.1.2-10.1.1.x86_64.rpm | 118 kB 00:00
(8/17): elfutils-devel-static-0.137-3.el5.x86_64.rpm | 119 kB 00:00
(9/17): libselinux-devel-1.33.4-5.5.el5.x86_64.rpm | 149 kB 00:00
(10/17): net-snmp-utils-5.3.2.2-7.el5_4.2.x86_64.rpm | 187 kB 00:00
(11/17): libsepol-devel-1.15.2-2.el5.x86_64.rpm | 192 kB 00:00
(12/17): nss-devel-3.12.6-1.el5.centos.x86_64.rpm | 233 kB 00:00
(13/17): sqlite-devel-3.3.6-5.x86_64.rpm | 257 kB 00:00
(14/17): net-snmp-libs-5.3.2.2-7.el5_4.2.i386.rpm | 1.3 MB 00:00
(15/17): rpm-devel-4.4.2.3-18.el5.x86_64.rpm | 1.3 MB 00:00
(16/17): net-snmp-devel-5.3.2.2-7.el5_4.2.i386.rpm | 1.9 MB 00:00
(17/17): net-snmp-devel-5.3.2.2-7.el5_4.2.x86_64.rpm | 2.0 MB 00:00
-----------------------------------------------------------------------------------------------------------------------------
Total 10 MB/s | 8.0 MB 00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : beecrypt 1/17
Installing : net-snmp-libs 2/17
Installing : beecrypt-devel 3/17
Installing : lm_sensors-devel 4/17
Installing : sqlite-devel 5/17
Installing : libsepol-devel 6/17
Installing : libselinux-devel 7/17
Installing : nspr-devel 8/17
Installing : net-snmp-utils 9/17
Installing : nss-devel 10/17
Installing : elfutils-libelf-devel 11/17
Installing : rpm-devel 12/17
Installing : elfutils-devel 13/17
Installing : elfutils-libelf-devel-static 14/17
Installing : net-snmp-devel 15/17
Installing : net-snmp-devel 16/17
Installing : elfutils-devel-static 17/17

Installed:
net-snmp-devel.i386 1:5.3.2.2-7.el5_4.2 net-snmp-devel.x86_64 1:5.3.2.2-7.el5_4.2
net-snmp-utils.x86_64 1:5.3.2.2-7.el5_4.2

Dependency Installed:
beecrypt.x86_64 0:4.1.2-10.1.1 beecrypt-devel.x86_64 0:4.1.2-10.1.1
elfutils-devel.x86_64 0:0.137-3.el5 elfutils-devel-static.x86_64 0:0.137-3.el5
elfutils-libelf-devel.x86_64 0:0.137-3.el5 elfutils-libelf-devel-static.x86_64 0:0.137-3.el5
libselinux-devel.x86_64 0:1.33.4-5.5.el5 libsepol-devel.x86_64 0:1.15.2-2.el5
lm_sensors-devel.x86_64 0:2.10.7-4.el5 net-snmp-libs.i386 1:5.3.2.2-7.el5_4.2
nspr-devel.x86_64 0:4.8.4-1.el5_4 nss-devel.x86_64 0:3.12.6-1.el5.centos
rpm-devel.x86_64 0:4.4.2.3-18.el5 sqlite-devel.x86_64 0:3.3.6-5

Complete!

Step 16:

So once the web interface installed the thing we are presented the login page into with default admin/admin username/password .Now I have change that password to like below:

username : admin

password : admin

Step 17:

Adding amazoncacti user to apache group:

[bhaskar@Amazon-instances ~]$ sudo /usr/sbin/usermod -G apache -a amazoncacti
[bhaskar@Amazon-instances ~]$ id amazoncacti
uid=503(amazoncacti) gid=503(cacti) groups=48(apache),503(cacti)


Step 18:

Installing new crontab for user amazoncacti for run the poller.php

[root@Amazon-instances html]# sudo su - amazoncacti
[amazoncacti@Amazon-instances ~]$ crontab -e
no crontab for amazoncacti - using an empty one
crontab: installing new crontab


Step 19:

Checking snmp work on localhost

[bhaskar@Amazon-instances log]$ sudo snmpwalk -v 1 localhost -c public
SNMPv2-MIB::sysDescr.0 = STRING: Linux Amazon-instances 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:34:28 EST 2008 x86_64
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (142712) 0:23:47.12
SNMPv2-MIB::sysContact.0 = STRING: Root
SNMPv2-MIB::sysName.0 = STRING: Amazon-instances
SNMPv2-MIB::sysLocation.0 = STRING: AmazonCloud
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORID.1 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.2 = OID: TCP-MIB::tcpMIB
SNMPv2-MIB::sysORID.3 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.4 = OID: UDP-MIB::udpMIB
SNMPv2-MIB::sysORID.5 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup
SNMPv2-MIB::sysORID.6 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.7 = OID: SNMP-MPD-MIB::snmpMPDCompliance
SNMPv2-MIB::sysORID.8 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance
SNMPv2-MIB::sysORDescr.1 = STRING: The MIB module for SNMPv2 entities
SNMPv2-MIB::sysORDescr.2 = STRING: The MIB module for managing TCP implementations
SNMPv2-MIB::sysORDescr.3 = STRING: The MIB module for managing IP and ICMP implementations
SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for managing UDP implementations
SNMPv2-MIB::sysORDescr.5 = STRING: View-based Access Control Model for SNMP.
SNMPv2-MIB::sysORDescr.6 = STRING: The SNMP Management Architecture MIB.
SNMPv2-MIB::sysORDescr.7 = STRING: The MIB for Message Processing and Dispatching.
SNMPv2-MIB::sysORDescr.8 = STRING: The management information definitions for the SNMP User-based Security Model.
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.6 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.7 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.8 = Timeticks: (0) 0:00:00.00
HOST-RESOURCES-MIB::hrSystemUptime.0 = Timeticks: (30377320) 3 days, 12:22:53.20
End of MIB


Step 20.

Newly created snmpd.conf

[bhaskar@Amazon-instances log]$ sudo cp -v /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.05022011
`/etc/snmp/snmpd.conf' -> `/etc/snmp/snmpd.conf.05022011'
[bhaskar@Amazon-instances log]$ sudo mv -v snmpd.conf /etc/snmp/
`snmpd.conf' -> `/etc/snmp/snmpd.conf'


Step 21:

plugin installation

[bhaskar@Amazon-instances ~]$ wget -c http://mirror.cactiusers.org/downloads/plugins/cacti-plugin-0.8.7g-PA-v2.8.tar.gz
-2011-05-04 02:52:11- http://mirror.cactiusers.org/downloads/plugins/cacti-plugin-0.8.7g-PA-v2.8.tar.gz
Resolving mirror.cactiusers.org... 209.189.228.150
Connecting to mirror.cactiusers.org|209.189.228.150|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 207069 (202K) [application/x-gzip]
Saving to: `cacti-plugin-0.8.7g-PA-v2.8.tar.gz'

100%[===================================================================================>] 207,069 583K/s in 0.3s

2011-05-04 02:52:12 (583 KB/s) - `cacti-plugin-0.8.7g-PA-v2.8.tar.gz' saved [207069/207069]


Step 22:

Untar it:

[bhaskar@Amazon-instances ~]$ tar -xvzf cacti-plugin-0.8.7g-PA-v2.8.tar.gz
cacti-plugin-arch/
cacti-plugin-arch/files-0.8.7g/
cacti-plugin-arch/files-0.8.7g/poller.php
cacti-plugin-arch/files-0.8.7g/host.php
cacti-plugin-arch/files-0.8.7g/utilities.php
cacti-plugin-arch/files-0.8.7g/lib/
cacti-plugin-arch/files-0.8.7g/lib/poller.php
cacti-plugin-arch/files-0.8.7g/lib/functions.php
cacti-plugin-arch/files-0.8.7g/lib/html.php
cacti-plugin-arch/files-0.8.7g/lib/auth.php
cacti-plugin-arch/files-0.8.7g/lib/api_device.php
cacti-plugin-arch/files-0.8.7g/lib/rrd.php
cacti-plugin-arch/files-0.8.7g/lib/plugins.php
cacti-plugin-arch/files-0.8.7g/lib/variables.php
cacti-plugin-arch/files-0.8.7g/lib/html_form.php
cacti-plugin-arch/files-0.8.7g/graphs_new.php
cacti-plugin-arch/files-0.8.7g/graph.php
cacti-plugin-arch/files-0.8.7g/auth_changepassword.php
cacti-plugin-arch/files-0.8.7g/user_admin.php
cacti-plugin-arch/files-0.8.7g/plugins/
cacti-plugin-arch/files-0.8.7g/plugins/index.php
cacti-plugin-arch/files-0.8.7g/images/
cacti-plugin-arch/files-0.8.7g/images/install_icon_disabled.png
cacti-plugin-arch/files-0.8.7g/images/disable_icon.png
cacti-plugin-arch/files-0.8.7g/images/install_icon.png
cacti-plugin-arch/files-0.8.7g/images/view_none.gif
cacti-plugin-arch/files-0.8.7g/images/uninstall_icon.gif
cacti-plugin-arch/files-0.8.7g/images/enable_icon_disabled.png
cacti-plugin-arch/files-0.8.7g/images/enable_icon.png
cacti-plugin-arch/files-0.8.7g/graphs.php
cacti-plugin-arch/files-0.8.7g/include/
cacti-plugin-arch/files-0.8.7g/include/global.php
cacti-plugin-arch/files-0.8.7g/include/global_form.php
cacti-plugin-arch/files-0.8.7g/include/top_header.php
cacti-plugin-arch/files-0.8.7g/include/top_graph_header.php
cacti-plugin-arch/files-0.8.7g/include/global_settings.php
cacti-plugin-arch/files-0.8.7g/include/auth.php
cacti-plugin-arch/files-0.8.7g/include/bottom_footer.php
cacti-plugin-arch/files-0.8.7g/include/config.php.dist
cacti-plugin-arch/files-0.8.7g/include/plugins.php
cacti-plugin-arch/files-0.8.7g/include/global_constants.php
cacti-plugin-arch/files-0.8.7g/include/global_arrays.php
cacti-plugin-arch/files-0.8.7g/graph_image.php
cacti-plugin-arch/files-0.8.7g/plugins.php
cacti-plugin-arch/files-0.8.7g/data_sources.php
cacti-plugin-arch/files-0.8.7g/index.php
cacti-plugin-arch/files-0.8.7g/auth_login.php
cacti-plugin-arch/pa.sql
cacti-plugin-arch/README
cacti-plugin-arch/LICENSE
cacti-plugin-arch/cacti-plugin-0.8.7g-PA-v2.8.diff

Step 23:

Took back up before applying the patch for plug in architechture

sudo cp -Rpv /var/www/html/cacti/ /var/www/html/cacti.orig

Step 24:

Copying file from PIA to actual cacti installation dir

[bhaskar@Amazon-instances ~]$ cd cacti-plugin-arch/

[bhaskar@Amazon-instances cacti-plugin-arch]$ ls
cacti-plugin-0.8.7g-PA-v2.8.diff files-0.8.7g LICENSE pa.sql README

[bhaskar@Amazon-instances cacti-plugin-arch]$ cd files-0.8.7g/

[bhaskar@Amazon-instances files-0.8.7g]$ ls
auth_changepassword.php graph_image.php graphs.php include plugins user_admin.php
auth_login.php graph.php host.php index.php plugins.php utilities.php
data_sources.php graphs_new.php images lib poller.php
[bhaskar@Amazon-instances files-0.8.7g]$


[bhaskar@Amazon-instances files-0.8.7g]$ sudo cp -Rv * /var/www/html/cacti/
`auth_changepassword.php' -> `/var/www/html/cacti/auth_changepassword.php'
`auth_login.php' -> `/var/www/html/cacti/auth_login.php'
`data_sources.php' -> `/var/www/html/cacti/data_sources.php'
`graph_image.php' -> `/var/www/html/cacti/graph_image.php'
`graph.php' -> `/var/www/html/cacti/graph.php'
`graphs_new.php' -> `/var/www/html/cacti/graphs_new.php'
`graphs.php' -> `/var/www/html/cacti/graphs.php'
`host.php' -> `/var/www/html/cacti/host.php'
`images/install_icon_disabled.png' -> `/var/www/html/cacti/images/install_icon_disabled.png'
`images/enable_icon.png' -> `/var/www/html/cacti/images/enable_icon.png'
`images/enable_icon_disabled.png' -> `/var/www/html/cacti/images/enable_icon_disabled.png'
`images/view_none.gif' -> `/var/www/html/cacti/images/view_none.gif'
`images/install_icon.png' -> `/var/www/html/cacti/images/install_icon.png'
`images/disable_icon.png' -> `/var/www/html/cacti/images/disable_icon.png'
`images/uninstall_icon.gif' -> `/var/www/html/cacti/images/uninstall_icon.gif'
`include/plugins.php' -> `/var/www/html/cacti/include/plugins.php'
`include/global_form.php' -> `/var/www/html/cacti/include/global_form.php'
`include/top_graph_header.php' -> `/var/www/html/cacti/include/top_graph_header.php'
`include/global_arrays.php' -> `/var/www/html/cacti/include/global_arrays.php'
`include/config.php.dist' -> `/var/www/html/cacti/include/config.php.dist'
`include/top_header.php' -> `/var/www/html/cacti/include/top_header.php'
`include/global.php' -> `/var/www/html/cacti/include/global.php'
`include/global_constants.php' -> `/var/www/html/cacti/include/global_constants.php'
`include/auth.php' -> `/var/www/html/cacti/include/auth.php'
`include/global_settings.php' -> `/var/www/html/cacti/include/global_settings.php'
`include/bottom_footer.php' -> `/var/www/html/cacti/include/bottom_footer.php'
`index.php' -> `/var/www/html/cacti/index.php'
`lib/plugins.php' -> `/var/www/html/cacti/lib/plugins.php'
`lib/rrd.php' -> `/var/www/html/cacti/lib/rrd.php'
`lib/variables.php' -> `/var/www/html/cacti/lib/variables.php'
`lib/api_device.php' -> `/var/www/html/cacti/lib/api_device.php'
`lib/poller.php' -> `/var/www/html/cacti/lib/poller.php'
`lib/html.php' -> `/var/www/html/cacti/lib/html.php'
`lib/functions.php' -> `/var/www/html/cacti/lib/functions.php'
`lib/auth.php' -> `/var/www/html/cacti/lib/auth.php'
`lib/html_form.php' -> `/var/www/html/cacti/lib/html_form.php'
`plugins' -> `/var/www/html/cacti/plugins'
`plugins/index.php' -> `/var/www/html/cacti/plugins/index.php'
`plugins.php' -> `/var/www/html/cacti/plugins.php'
`poller.php' -> `/var/www/html/cacti/poller.php'
`user_admin.php' -> `/var/www/html/cacti/user_admin.php'
`utilities.php' -> `/var/www/html/cacti/utilities.php'

step 25:

9. permission need to be chaged

[bhaskar@Amazon-instances cacti]$ ls -al
total 1100
drwxr-xr-x 13 amazoncacti cacti 4096 May 4 03:00 .
drwxr-xr-x 4 root root 4096 May 4 02:56 ..
-rw-r-r- 1 amazoncacti cacti 6199 Jul 9 2010 about.php
-rw-r-r- 1 amazoncacti cacti 5187 May 4 03:00 auth_changepassword.php
-rw-r-r- 1 amazoncacti cacti 13396 May 4 03:00 auth_login.php
-rw-r-r- 1 amazoncacti cacti 176144 Jul 9 2010 cacti.sql
-rw-r-r- 1 amazoncacti cacti 21643 Jul 9 2010 cdef.php
drwxr-xr-x 2 amazoncacti cacti 4096 Jul 9 2010 cli
-rw-r-r- 1 amazoncacti cacti 19760 Jul 9 2010 cmd.php
-rw-r-r- 1 amazoncacti cacti 6974 Jul 9 2010 color.php
-rw-r-r- 1 amazoncacti cacti 25025 Jul 9 2010 data_input.php
-rw-r-r- 1 amazoncacti cacti 35455 Jul 9 2010 data_queries.php
-rw-r-r- 1 amazoncacti cacti 58617 May 4 03:00 data_sources.php
-rw-r-r- 1 amazoncacti cacti 32871 Jul 9 2010 data_templates.php
drwxr-xr-x 5 amazoncacti cacti 4096 Jul 9 2010 docs
-rw-r-r- 1 amazoncacti cacti 6107 Jul 9 2010 gprint_presets.php
-rw-r-r- 1 amazoncacti cacti 3492 May 4 03:00 graph_image.php
-rw-r-r- 1 amazoncacti cacti 12667 May 4 03:00 graph.php
-rw-r-r- 1 amazoncacti cacti 7805 Jul 9 2010 graph_settings.php
-rw-r-r- 1 amazoncacti cacti 17409 Jul 9 2010 graphs_items.php
-rw-r-r- 1 amazoncacti cacti 39908 May 4 03:00 graphs_new.php
-rw-r-r- 1 amazoncacti cacti 60077 May 4 03:00 graphs.php
-rw-r-r- 1 amazoncacti cacti 10006 Jul 9 2010 graph_templates_inputs.php
-rw-r-r- 1 amazoncacti cacti 18526 Jul 9 2010 graph_templates_items.php
-rw-r-r- 1 amazoncacti cacti 26606 Jul 9 2010 graph_templates.php
-rw-r-r- 1 amazoncacti cacti 38470 Jul 9 2010 graph_view.php
-rw-r-r- 1 amazoncacti cacti 5840 Jul 9 2010 graph_xport.php
-rw-r-r- 1 amazoncacti cacti 58003 May 4 03:00 host.php
-rw-r-r- 1 amazoncacti cacti 20016 Jul 9 2010 host_templates.php
drwxr-xr-x 2 amazoncacti cacti 4096 May 4 03:00 images
drwxr-xr-x 4 amazoncacti cacti 4096 May 4 03:00 include
-rw-r-r- 1 amazoncacti cacti 2313 May 4 03:00 index.php
drwxr-xr-x 2 amazoncacti cacti 4096 Jul 9 2010 install
drwxr-xr-x 3 amazoncacti cacti 4096 May 4 03:00 lib
-rw-r-r- 1 amazoncacti cacti 15141 Dec 30 2009 LICENSE
drwxr-xr-x 2 amazoncacti cacti 4096 May 2 02:53 log
-rw-r-r- 1 amazoncacti cacti 2641 Jul 9 2010 logout.php
drwxr-xr-x 2 amazoncacti cacti 4096 May 4 03:00 plugins
-rw-r-r- 1 amazoncacti cacti 25848 May 4 03:00 plugins.php
-rw-r-r- 1 amazoncacti cacti 4304 Jul 9 2010 poller_commands.php
-rw-r-r- 1 amazoncacti cacti 2243 Jul 9 2010 poller_export.php
-rw-r-r- 1 amazoncacti cacti 17909 May 4 03:00 poller.php
-rw-r-r- 1 amazoncacti cacti 48 Dec 30 2009 README
drwxr-xr-x 5 amazoncacti cacti 4096 Dec 30 2009 resource
drwxr-xr-x 2 amazoncacti cacti 4096 May 3 11:45 rra
-rw-r-r- 1 amazoncacti cacti 7233 Jul 9 2010 rra.php
drwxr-xr-x 2 amazoncacti cacti 4096 May 3 11:11 scripts
-rw-r-r- 1 amazoncacti cacti 8270 Jul 9 2010 script_server.php
-rw-r-r- 1 amazoncacti cacti 353 Dec 30 2009 script_server.pl
-rw-r-r- 1 amazoncacti cacti 4995 Jul 9 2010 settings.php
-rw-r-r- 1 amazoncacti cacti 6086 Jul 9 2010 templates_export.php
-rw-r-r- 1 amazoncacti cacti 6526 Jul 9 2010 templates_import.php
-rw-r-r- 1 amazoncacti cacti 19435 Jul 9 2010 tree.php
-rw-r-r- 1 amazoncacti cacti 44603 May 4 03:00 user_admin.php
-rw-r-r- 1 amazoncacti cacti 64999 May 4 03:00 utilities.php

Now should file below command:

[bhaskar@Amazon-instances cacti]$ sudo chown -R amazoncacti:cacti *
[bhaskar@Amazon-instances cacti]$ ls -al
total 1100
drwxr-xr-x 13 amazoncacti cacti 4096 May 4 03:00 .
drwxr-xr-x 4 root root 4096 May 4 02:56 ..
-rw-r-r- 1 amazoncacti cacti 6199 Jul 9 2010 about.php
-rw-r-r- 1 amazoncacti cacti 5187 May 4 03:00 auth_changepassword.php
-rw-r-r- 1 amazoncacti cacti 13396 May 4 03:00 auth_login.php
-rw-r-r- 1 amazoncacti cacti 176144 Jul 9 2010 cacti.sql
-rw-r-r- 1 amazoncacti cacti 21643 Jul 9 2010 cdef.php
drwxr-xr-x 2 amazoncacti cacti 4096 Jul 9 2010 cli
-rw-r-r- 1 amazoncacti cacti 19760 Jul 9 2010 cmd.php
-rw-r-r- 1 amazoncacti cacti 6974 Jul 9 2010 color.php
-rw-r-r- 1 amazoncacti cacti 25025 Jul 9 2010 data_input.php
-rw-r-r- 1 amazoncacti cacti 35455 Jul 9 2010 data_queries.php
-rw-r-r- 1 amazoncacti cacti 58617 May 4 03:00 data_sources.php
-rw-r-r- 1 amazoncacti cacti 32871 Jul 9 2010 data_templates.php
drwxr-xr-x 5 amazoncacti cacti 4096 Jul 9 2010 docs
-rw-r-r- 1 amazoncacti cacti 6107 Jul 9 2010 gprint_presets.php
-rw-r-r- 1 amazoncacti cacti 3492 May 4 03:00 graph_image.php
-rw-r-r- 1 amazoncacti cacti 12667 May 4 03:00 graph.php
-rw-r-r- 1 amazoncacti cacti 7805 Jul 9 2010 graph_settings.php
-rw-r-r- 1 amazoncacti cacti 17409 Jul 9 2010 graphs_items.php
-rw-r-r- 1 amazoncacti cacti 39908 May 4 03:00 graphs_new.php
-rw-r-r- 1 amazoncacti cacti 60077 May 4 03:00 graphs.php
-rw-r-r- 1 amazoncacti cacti 10006 Jul 9 2010 graph_templates_inputs.php
-rw-r-r- 1 amazoncacti cacti 18526 Jul 9 2010 graph_templates_items.php
-rw-r-r- 1 amazoncacti cacti 26606 Jul 9 2010 graph_templates.php
-rw-r-r- 1 amazoncacti cacti 38470 Jul 9 2010 graph_view.php
-rw-r-r- 1 amazoncacti cacti 5840 Jul 9 2010 graph_xport.php
-rw-r-r- 1 amazoncacti cacti 58003 May 4 03:00 host.php
-rw-r-r- 1 amazoncacti cacti 20016 Jul 9 2010 host_templates.php
drwxr-xr-x 2 amazoncacti cacti 4096 May 4 03:00 images
drwxr-xr-x 4 amazoncacti cacti 4096 May 4 03:00 include
-rw-r-r- 1 amazoncacti cacti 2313 May 4 03:00 index.php
drwxr-xr-x 2 amazoncacti cacti 4096 Jul 9 2010 install
drwxr-xr-x 3 amazoncacti cacti 4096 May 4 03:00 lib
-rw-r-r- 1 amazoncacti cacti 15141 Dec 30 2009 LICENSE
drwxr-xr-x 2 amazoncacti cacti 4096 May 2 02:53 log
-rw-r-r- 1 amazoncacti cacti 2641 Jul 9 2010 logout.php
drwxr-xr-x 2 amazoncacti cacti 4096 May 4 03:00 plugins
-rw-r-r- 1 amazoncacti cacti 25848 May 4 03:00 plugins.php
-rw-r-r- 1 amazoncacti cacti 4304 Jul 9 2010 poller_commands.php
-rw-r-r- 1 amazoncacti cacti 2243 Jul 9 2010 poller_export.php
-rw-r-r- 1 amazoncacti cacti 17909 May 4 03:00 poller.php
-rw-r-r- 1 amazoncacti cacti 48 Dec 30 2009 README
drwxr-xr-x 5 amazoncacti cacti 4096 Dec 30 2009 resource
drwxr-xr-x 2 amazoncacti cacti 4096 May 3 11:45 rra
-rw-r-r- 1 amazoncacti cacti 7233 Jul 9 2010 rra.php
drwxr-xr-x 2 amazoncacti cacti 4096 May 3 11:11 scripts
-rw-r-r- 1 amazoncacti cacti 8270 Jul 9 2010 script_server.php
-rw-r-r- 1 amazoncacti cacti 353 Dec 30 2009 script_server.pl
-rw-r-r- 1 amazoncacti cacti 4995 Jul 9 2010 settings.php
-rw-r-r- 1 amazoncacti cacti 6086 Jul 9 2010 templates_export.php
-rw-r-r- 1 amazoncacti cacti 6526 Jul 9 2010 templates_import.php
-rw-r-r- 1 amazoncacti cacti 19435 Jul 9 2010 tree.php
-rw-r-r- 1 amazoncacti cacti 44603 May 4 03:00 user_admin.php
-rw-r-r- 1 amazoncacti cacti 64999 May 4 03:00 utilities.php

Step 26:

patching the cacti installation dir for PIA

Upon dry run we get this:

[bhaskar@Amazon-instances cacti]$ sudo patch -p1 -N --dry-run < /home/bhaskar/cacti-plugin-arch/cacti-plugin-0.8.7g-PA-v2.8.diff
patching file auth_changepassword.php
patching file auth_login.php
Hunk #3 FAILED at 279.
1 out of 4 hunks FAILED -- saving rejects to file auth_login.php.rej
patching file data_sources.php
patching file graph_image.php
patching file graph.php
patching file graphs_new.php
patching file graphs.php
patching file host.php
patching file images/disable_icon.png
patching file images/enable_icon_disabled.png
patching file images/enable_icon.png
patching file images/install_icon_disabled.png
patching file images/install_icon.png
patching file images/uninstall_icon.gif
patching file images/view_none.gif
patching file include/auth.php
patching file include/bottom_footer.php
patching file include/config.php
Hunk #1 succeeded at 30 with fuzz 1.
patching file include/global_arrays.php
patching file include/global_constants.php
patching file include/global_form.php
patching file include/global.php
patching file include/global_settings.php
patching file include/plugins.php
patching file include/top_graph_header.php
patching file include/top_header.php
Hunk #1 FAILED at 22.
1 out of 4 hunks FAILED -- saving rejects to file include/top_header.php.rej
patching file index.php
patching file lib/api_device.php
patching file lib/auth.php
patching file lib/functions.php
patching file lib/html_form.php
patching file lib/html.php
patching file lib/plugins.php
patching file lib/poller.php
patching file lib/rrd.php
patching file lib/variables.php
patching file plugins/index.php
patching file plugins.php
patching file poller.php
patching file user_admin.php
patching file utilities.php

Step 26:

problem.....we need to get those two file from old location if we go ahed and do the patching

let's go:

[bhaskar@Amazon-instances cacti.orig]$ sudo cp -pv include/top_header.php /var/www/html/cacti/include/
`include/top_header.php' -> `/var/www/html/cacti/include/top_header.php'

[bhaskar@Amazon-instances cacti.orig]$ sudo cp -pv auth_login.php /var/www/html/cacti/
`auth_login.php' -> `/var/www/html/cacti/auth_login.php'


So failed patched files are copied back to modified dir.

Step 27:

Applying patched for PIA in the database

[bhaskar@Amazon-instances cacti-plugin-arch]$ sudo mysql -u amazoncacti -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1156
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| cacti |
| test |
+--------------------+
3 rows in set (0.00 sec)

mysql> use cacti;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> source pa.sql
Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

mysql>


Step 28:

Downloading plug ins

[bhaskar@Amazon-instances ~]$ wget -c http://cactiusers.org/downloads/discovery.gzip
-2011-05-04 04:58:19- http://cactiusers.org/downloads/discovery.gzip
Resolving cactiusers.org... 209.189.228.151
Connecting to cactiusers.org|209.189.228.151|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://mirror.cactiusers.org/downloads/plugins/discovery-0.8.5.tar.gz [following]
-2011-05-04 04:58:21- http://mirror.cactiusers.org/downloads/plugins/discovery-0.8.5.tar.gz
Resolving mirror.cactiusers.org... 209.189.228.150
Connecting to mirror.cactiusers.org|209.189.228.150|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 30377 (30K) [application/x-gzip]
Saving to: `discovery-0.8.5.tar.gz'

100%[===================================================================================>] 30,377 --.-K/s in 0.1s

2011-05-04 04:58:21 (219 KB/s) - `discovery-0.8.5.tar.gz' saved [30377/30377]


Step 29:

Unzip it

[bhaskar@Amazon-instances ~]$ tar -xvzf discovery-0.8.5.tar.gz
discovery/README
discovery/index.php
discovery/discover.sql
discovery/setup.php
discovery/discover_template.php
discovery/findhosts.php
discovery/discover.php
discovery/images/index.php
discovery/images/tab_discover.gif
discovery/config.php
discovery/LICENSE

Step 30:

move the plug in dir to cacti's plugin dir

[bhaskar@Amazon-instances ~]$ sudo mv -v discovery /var/www/html/cacti/plugins/
`discovery' -> `/var/www/html/cacti/plugins/discovery'


Step 31:

Activate the plug in:

put a line like this in /var/www/html/cacti/include/config.php

$plugins[] = 'discovery';

### For every extra downloaded plug in we need to put up a line like this.

Now time for some graph..disk usage:




Here is another one memory usage:




Here one for the cpu usage;





Here something for eth0 and processes;





Hope this will help. Cacti is certainly not the easiest graphing solutions..but very cool to have one.

Cheers!
Bhaskar