Quantcast
Channel: Bassem's Weblog » Security Vs Non-Security
Viewing all articles
Browse latest Browse all 3

Cacti Quick Installation [ Monitor Your Network ]

$
0
0
Cacti Quick Installation
Machine:
OS : RHEL
Required Packages:
1- Data Base Packages:  mysql-server | mysql
2- SNMP: net-snmp | net-snmp-utils | php-snmp | net-snmp-libs
2- PHP packages: php |  php-mysql  | php-pear | php-common | php-gd | php-devel | php-mbstring | php-cli  | php-snmp  | php-pear-Net-SMTP
3- Apache: httpd
4-Rddtool: rrdtool |rrdtool-perl  (http://packages.sw.be/rrdtool/ )
5- Cacti itself :)
——–
1- Make sure that all of your packages already exist

[root@B@ssem]# for i in mysql-server mysql php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli php-snmp php-pear-Net-SMTP  httpd  net-snmp-utils php-snmp net-snmp-libs net-snmp; do rpm -qa | grep $i; done
Mysql-server-5.0.77-3.el5
Php-mysql-5.1.6-23.2.el5_3
Mysql-5.0.77-3.el5
Php-pear-1.4.9-6.el5
Php-devel-5.1.6-23.2.el5_3
Php-cli-5.1.6-23.2.el5_3
Php-snmp-5.1.6-23.2.el5_3
Php-mbstring-5.1.6-23.2.el5_3
Php-gd-5.1.6-23.2.el5_3
Php-common-5.1.6-23.2.el5_3
Php-devel-5.1.6-23.2.el5_3
Php-5.1.6-23.2.el5_3
Httpd-2.2.3-31.el5
net-snmp-5.3.2.2-7.el5
net-snmp-utils-5.3.2.2-7.el5
php-snmp-5.1.6-23.2.el5_3
net-snmp-libs-5.3.2.2-7.el5

2- Configure and Create cacti MySQL database

@ Setting mysql password for root
# mysqladmin -u root password NEWPASSWORD
@ Create cacti MySQL database
#mysql -u root -p -e 'create database cacti'
# mysql -u root -p
mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'X';
mysql> FLUSH privileges;
mysql> \q

3- Configure SNMP

# vim /etc/snmp/snmpd.conf
Modify the following Parameters:
com2sec local     localhost           public
group MyRWGroup v1         local
group MyRWGroup v2c        local
group MyRWGroup usm        local
view all    included  .1                               80
access MyRWGroup “”      any       noauth    exact  all    all    none
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root  (configure /etc/snmp/snmp.local.conf)
pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat
Next
# /etc/init.d/snmpd start ; chkconfig snmpd on
Now we will test snmp:
#snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex
The output Should be like this:


IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER: 1
IP-MIB::ipAdEntIfIndex.196.202.1.8 = INTEGER: 2
.
4- Install and configure Cacti

- Download cacti-version.tar.gz from cacti website then unpack it in /var/www/html
#tar xzvf cacti-version.tar.gz
- Import the default cacti database:
# mysql cacti < cacti.sql –p
- Create cacti user
#useradd cacti -s /sbin/nologin -d /var/www/html/cacti-0.8.7g/
- Edit include/config.php and specify the database type, name, host, user and password for your Cacti configuration:
.
$database_type = “mysql”;
$database_default = “cacti”;
$database_hostname = “localhost”;
$database_username = “cacti”;
$database_password = “XXX”;
$database_port = “3306″;
.
@ Set the appropriate permissions on cacti’s directories for graph/log generation. You should execute these commands from inside cacti’s directory to change the permissions.
#Cd /var/www/html/cacti-version/
#Chown -R cactiuser rra/ log/
@ Add a line to your /etc/crontab file similar to: “*/5 * * * * cacti php /var/www/html/cacti-version/poller.php > /dev/null 2>&1″
.
5- Configure Apache

# vim /etc/httpd/conf.d/cacti.conf
#
# Cacti: An rrd based graphing tool
#
Alias /cacti    /var/www/html/cacti-version
<Directory /var/www/html/cacti-version>
Order Deny,Allow
Deny from all
Allow from 192.168.1.0/24
</Directory>
#/etc/init.d/httpd restart
.
@ Now login to yourwebsite/cacti
- The default username and password [ admin ]

You’ll be forced to change the password after first login

Hope that was usefull,
Bassem



Viewing all articles
Browse latest Browse all 3

Trending Articles