Showing posts with label centos. Show all posts
Showing posts with label centos. Show all posts

Thursday, May 7, 2015

How to install Flow-tools and Flow-viewer on Centos 6.5

This document is specifically made for installing the Flow-tools on Centos 6.5 and Below version of Flow-tools and Flow-viewers are used in it.

    Flow Tools:   flow-tools-0.68.5.1
    Flow Viewer:  FlowViewer_4.6

Flow-tools Installation:

Download the flowtools and install it...
        wget https://flow-tools.googlecode.com/files/flow-tools-0.68.5.1.tar.bz2
        tar -xvjf flow-tools-0.68.5.1.tar.bz2
        cd flow-tools-0.68.5.1
        yum install make tcp_wrappers zlib gcc
        ./configure
        gmake
        gmake install


Install FlowViewer Dependencies:
           yum install gd libgd gd-devel rrdtool
    Download  and install GD for cpan:      
           wget http://search.cpan.org/CPAN/authors/id/L/LD/LDS/GD-2.56.tar.gz
           tar -zxvf GD-2.56.tar.gz
           cd GD-2.56
           perl ./Build.PL
           ./Build
           sudo ./Build install       
           yum install perl-ExtUtils-MakeMaker*
    Download and install ExtUtils-makeMaker
           wget http://search.cpan.org/CPAN/authors/id/M/MS/MSTROUT/ExtUtils-MakeMaker-6.58_01.tar.gz
           tar -zxvf ExtUtils-MakeMaker-6.58_01.tar.gz
           cd ExtUtils-MakeMaker-6.58_01
           perl Makefile.PL
           make
           sudo make install
FlowViewer installation and configuration:
           wget http://downloads.sourceforge.net/project/flowviewer/FlowViewer_4.6.tar
          tar -xvf FlowViewer_4.6.tar
          yum install httpd
          mv FlowViewer_4.6 /var/www/cgi-bin/flowviewer

FlowViewer Configuration:

Edit the FlowViewer_Configuration.pm file and update the path.. make sure the Paths are Valid if the Floders are not exist.. Please create it manually.
Copy the config file to the correct directory.
          cp /var/www/cgi-bin/flowviewer/tools/flow-capture-table.conf /etc/flow-capture-table.conf

Edit the flow-capture-table.conf file and update the router and port number details.
Copy the flowcapture init script to the init.d directory.
           cp /var/www/cgi-bin/flowviewer/tools/flowcapture_restart /etc/init.d/flowcapture

Start the flowcapture..
            /etc/init.d/flowcapture start

Point your browser to http://<YOUR -SERVER_IP>/cgi-bin/flowviewer/FV.cgi

P.S: flowgrapher Setup is not updated in the installtion. I will add it in future..

P.S: Use http://ipsubnetcalculator.net/  for calculating IP subnet mask Online

Saturday, December 6, 2014

How to Install Cacti on Centos



This procedure explains the Cacti installation on Centos Server using Yum.


Step1: Install the dependencies.

[:vishnu:root@sandbox ~]# yum install mysql-server mysql php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli php-snmp php-pear-Net-SMTP php-mysql httpd

[:vishnu:root@sandbox ~]# yum install net-snmp-utils php-snmp net-snmp-libs


Step2: start mysqld and configure it

[:vishnu:root@sandbox ~]# service mysqld status
mysqld is stopped
[:vishnu:root@sandbox ~]# service mysqld start

Initializing MySQL database: Installing MySQL system tables...
OK
<<Output Suppressed>>
[ OK ]
Starting MySQL: [ OK ]
[:vishnu:root@sandbox ~]#
[:vishnu:root@sandbox ~]# /usr/bin/mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In <Output Omitted>
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] Y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] Y
... Success!
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] Y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] Y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!


Step3: Install Cacti

[:vishnu:root@sandbox ~]# yum install net-snmp-utils php-snmp net-snmp-libs
[:vishnu:root@sandbox ~]# yum install cacti
If cacti package is not available. Add the below repo to your machine and run the command again.
#vim /etc/yum.repos.d/dag.repo:
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
enabled=1

Step4: Install Spine

Download the latest file from the cacti.net

tar xvzf cacti-spine-*.tar.gz
cd cacti-spine-*
./configure
make
sudo make install
Spine Path /usr/local/spine/bin/spine ​


Step5: Update the correct database details in /var/www/cacti/include/config.php

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


Step6: Spine config: update the below variables in spine.conf file
###Copy the config file first
cp /usr/local/spine/etc/spine.conf.dist /usr/local/spine/etc/spine.conf

DB_Host localhost
DB_Database cacti
DB_User cacti
DB_Pass cacti
DB_Port 3306
DB_PreG 0

step:6 create a database called cacti in mysql
#mysql -u root -p
#mysqladmin --user=root create cacti
#mysql --user=root mysql
mysql# GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword';
mysql# flush privileges;​

Step:7 Correct the Folder permission:
cd /var/www/cacti/
chown -R cacti rra/ log/

Step:8 Edit the cacti.conf file and add the "allow from all" in it.

#vim /etc/httpd/conf.d/cacti.conf
Alias /cacti/ /var/www/cacti/
<Directory /var/www/cacti/>
DirectoryIndex index.php
Options -Indexes
AllowOverride all
order deny,allow
deny from all
allow from all
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc on
php_flag track_vars on
</Directory>

Step:9 reload httpd config file.
# service httpd reload


Step 10 point your browser to:
http://your-server/cacti



P.S: Use http://ipsubnetcalculator.net/  for calculating IP subnet mask Online

Wednesday, August 28, 2013

groupadd error while installing quagga on Centos 5.4


While installing the quagga rpm on centos5.4 we got the below error.

[::root@test /var/tmp]# rpm -ivh quagga-0.98.6-11.el5.x86_64.rpm
Preparing...                ########################################### [100%]
error: %pre(quagga-0.98.6-11.el5.x86_64) scriptlet failed, signal 2
error:   install: %pre scriptlet failed (2), skipping quagga-0.98.6-11.el5
[::root@test /var/tmp]#

debug for the same is mentioned below.

[::root@test /var/tmp]# rpm -ivvh quagga-0.98.6-11.el5.x86_64.rpm
D: ============== quagga-0.98.6-11.el5.x86_64.rpm
D: Expected size:      1181289 = lead(96)+sigs(344)+pad(0)+data(1180849)
D:   Actual size:      1181289
D: opening  db environment /var/lib/rpm/Packages joinenv
D: opening  db index       /var/lib/rpm/Packages rdonly mode=0x0
D: locked   db index       /var/lib/rpm/Packages
D: opening  db index       /var/lib/rpm/Pubkeys rdonly mode=0x0
D:  read h#     570 Header sanity check: OK
D: ========== DSA pubkey id a8a447dc e8562897 (h#570)
D: quagga-0.98.6-11.el5.x86_64.rpm: Header V3 DSA signature: OK, key ID e8562897
D:     added binary package [0]
D: found 0 source and 1 binary packages
D: ========== +++ quagga-0.98.6-11.el5 x86_64/linux 0x2
D: opening  db index       /var/lib/rpm/Depends create mode=0x0
D: opening  db index       /var/lib/rpm/Basenames rdonly mode=0x0
D:  read h#      37 Header V3 DSA signature: OK, key ID e8562897
D:  Requires: /bin/bash                                     YES (db files)
D:  Requires: /bin/sh                                       YES (db files)
D:  Requires: /bin/sh                                       YES (cached)
D:  Requires: /bin/sh                                       YES (cached)
D:  Requires: /bin/sh                                       YES (cached)
D:  Requires: config(quagga) = 0:0.98.6-11.el5              YES (added provide)
D: opening  db index       /var/lib/rpm/Providename rdonly mode=0x0
D:  read h#      23 Header V3 DSA signature: OK, key ID e8562897
D:  Requires: libc.so.6()(64bit)                            YES (db provides)
D:  Requires: libc.so.6(GLIBC_2.2.5)(64bit)                 YES (db provides)
D:  Requires: libc.so.6(GLIBC_2.3)(64bit)                   YES (db provides)
D:  Requires: libc.so.6(GLIBC_2.3.4)(64bit)                 YES (db provides)
D:  Requires: libc.so.6(GLIBC_2.4)(64bit)                   YES (db provides)
D:  read h#      48 Header V3 DSA signature: OK, key ID e8562897
D:  Requires: libcap.so.1()(64bit)                          YES (db provides)
D:  Requires: libcrypt.so.1()(64bit)                        YES (db provides)
D:  Requires: libcrypt.so.1(GLIBC_2.2.5)(64bit)             YES (db provides)
D:  Requires: libm.so.6()(64bit)                            YES (db provides)
D:  Requires: libm.so.6(GLIBC_2.2.5)(64bit)                 YES (db provides)
D:  Requires: libospf.so.0()(64bit)                         YES (added provide)
D:  Requires: libospfapiclient.so.0()(64bit)                YES (added provide)
D:  read h#     368 Header V3 DSA signature: OK, key ID e8562897
D:  Requires: libpam.so.0()(64bit)                          YES (db provides)
D:  Requires: libpam.so.0(LIBPAM_1.0)(64bit)                YES (db provides)
D:  Requires: libpam_misc.so.0()(64bit)                     YES (db provides)
D:  Requires: libpam_misc.so.0(LIBPAM_MISC_1.0)(64bit)      YES (db provides)
D:  read h#      45 Header V3 DSA signature: OK, key ID e8562897
D:  Requires: libreadline.so.5()(64bit)                     YES (db provides)
D:  read h#      36 Header V3 DSA signature: OK, key ID e8562897
D:  Requires: libtermcap.so.2()(64bit)                      YES (db provides)
D:  Requires: libzebra.so.0()(64bit)                        YES (added provide)
D:  Requires: rpmlib(CompressedFileNames) <= 3.0.4-1        YES (rpmlib provides)
D:  Requires: rpmlib(PayloadFilesHavePrefix) <= 4.0-1       YES (rpmlib provides)
D:  Requires: rtld(GNU_HASH)                                YES (db provides)
D: Conflicts: bird                                          NO 
D: Conflicts: gated                                         NO 
D: Conflicts: mrt                                           NO 
D: Conflicts: zebra                                         NO 
D: opening  db index       /var/lib/rpm/Conflictname rdonly mode=0x0
D: closed   db index       /var/lib/rpm/Depends
D: ========== recording tsort relations
D:  Requires: libospf.so.0()(64bit)                         YES (added provide)
D:  Requires: libospfapiclient.so.0()(64bit)                YES (added provide)
D:  Requires: libzebra.so.0()(64bit)                        YES (added provide)
D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth, breadth)
D:     0    0    0    0    1    0   +quagga-0.98.6-11.el5.x86_64
D: installing binary packages
D: closed   db index       /var/lib/rpm/Pubkeys
D: closed   db index       /var/lib/rpm/Conflictname
D: closed   db index       /var/lib/rpm/Providename
D: closed   db index       /var/lib/rpm/Basenames
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages
D: opening  db environment /var/lib/rpm/Packages joinenv
D: opening  db index       /var/lib/rpm/Packages create mode=0x42
D: mounted filesystems:
D:     i        dev    bsize       bavail       iavail mount point
D:     0 0x00000802     4096     53388830     60616626 /
D:     1 0x00000003     4096            0           -1 /proc
D:     2 0x00000000     4096            0           -1 /sys
D:     3 0x0000000c     4096            0           -1 /dev/pts
D:     4 0x00000801     1024       455275       128484 /boot
D:     5 0x00000013     4096       496282       496281 /dev/shm
D:     6 0x00000014     4096            0           -1 /proc/sys/fs/binfmt_misc
D:     7 0x00000015     4096            0           -1 /var/lib/nfs/rpc_pipefs
D: sanity checking 1 elements
D: opening  db index       /var/lib/rpm/Name create mode=0x42
D: running pre-transaction scripts
D: computing 73 file fingerprints
Preparing...                D: computing file dispositions
D: opening  db index       /var/lib/rpm/Basenames create mode=0x42
########################################### [100%]
D: ========== +++ quagga-0.98.6-11.el5 x86_64-linux 0x2
D: Expected size:      1181289 = lead(96)+sigs(344)+pad(0)+data(1180849)
D:   Actual size:      1181289
D: quagga-0.98.6-11.el5: Header V3 DSA signature: OK, key ID e8562897
D:   install: quagga-0.98.6-11.el5 has 73 files, test = 0
D: opening  db index       /var/lib/rpm/Triggername create mode=0x42
D:   install: %pre(quagga-0.98.6-11.el5.x86_64) asynchronous scriptlet start
D:   install: %pre(quagga-0.98.6-11.el5.x86_64)    execv(/bin/sh) pid 4199
+ groupadd -g 85 -r quaggavt
D:   install: waitpid(4199) rc 4199 status 2 secs 11.664
error: %pre(quagga-0.98.6-11.el5.x86_64) scriptlet failed, signal 2
error:   install: %pre scriptlet failed (2), skipping quagga-0.98.6-11.el5
D: running post-transaction scripts
D: closed   db index       /var/lib/rpm/Triggername
D: closed   db index       /var/lib/rpm/Basenames
D: closed   db index       /var/lib/rpm/Name
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages
D: May free Score board((nil))
[::root@apan1.pop4 /var/tmp]# rpm -ivvvh quagga-0.98.6-11.el5.x86_64.rpm
D: ============== quagga-0.98.6-11.el5.x86_64.rpm
D: Expected size:      1181289 = lead(96)+sigs(344)+pad(0)+data(1180849)
D:   Actual size:      1181289
D: opening  db environment /var/lib/rpm/Packages joinenv
D: opening  db index       /var/lib/rpm/Packages rdonly mode=0x0
D: locked   db index       /var/lib/rpm/Packages
D: opening  db index       /var/lib/rpm/Pubkeys rdonly mode=0x0
D:  read h#     570 Header sanity check: OK
D: ========== DSA pubkey id a8a447dc e8562897 (h#570)
D: quagga-0.98.6-11.el5.x86_64.rpm: Header V3 DSA signature: OK, key ID e8562897
D:     added binary package [0]
D: found 0 source and 1 binary packages
D: ========== +++ quagga-0.98.6-11.el5 x86_64/linux 0x2
D: opening  db index       /var/lib/rpm/Depends create mode=0x0
D: opening  db index       /var/lib/rpm/Basenames rdonly mode=0x0
D:  read h#      37 Header V3 DSA signature: OK, key ID e8562897
D:  Requires: /bin/bash                                     YES (db files)
D:  Requires: /bin/sh                                       YES (db files)
D:  Requires: /bin/sh                                       YES (cached)
D:  Requires: /bin/sh                                       YES (cached)
D:  Requires: /bin/sh                                       YES (cached)
D:  Requires: config(quagga) = 0:0.98.6-11.el5              YES (added provide)
D: opening  db index       /var/lib/rpm/Providename rdonly mode=0x0
D:  read h#      23 Header V3 DSA signature: OK, key ID e8562897
D:  Requires: libc.so.6()(64bit)                            YES (db provides)
D:  Requires: libc.so.6(GLIBC_2.2.5)(64bit)                 YES (db provides)
D:  Requires: libc.so.6(GLIBC_2.3)(64bit)                   YES (db provides)
D:  Requires: libc.so.6(GLIBC_2.3.4)(64bit)                 YES (db provides)
D:  Requires: libc.so.6(GLIBC_2.4)(64bit)                   YES (db provides)
D:  read h#      48 Header V3 DSA signature: OK, key ID e8562897
D:  Requires: libcap.so.1()(64bit)                          YES (db provides)
D:  Requires: libcrypt.so.1()(64bit)                        YES (db provides)
D:  Requires: libcrypt.so.1(GLIBC_2.2.5)(64bit)             YES (db provides)
D:  Requires: libm.so.6()(64bit)                            YES (db provides)
D:  Requires: libm.so.6(GLIBC_2.2.5)(64bit)                 YES (db provides)
D:  Requires: libospf.so.0()(64bit)                         YES (added provide)
D:  Requires: libospfapiclient.so.0()(64bit)                YES (added provide)
D:  read h#     368 Header V3 DSA signature: OK, key ID e8562897
D:  Requires: libpam.so.0()(64bit)                          YES (db provides)
D:  Requires: libpam.so.0(LIBPAM_1.0)(64bit)                YES (db provides)
D:  Requires: libpam_misc.so.0()(64bit)                     YES (db provides)
D:  Requires: libpam_misc.so.0(LIBPAM_MISC_1.0)(64bit)      YES (db provides)
D:  read h#      45 Header V3 DSA signature: OK, key ID e8562897
D:  Requires: libreadline.so.5()(64bit)                     YES (db provides)
D:  read h#      36 Header V3 DSA signature: OK, key ID e8562897
D:  Requires: libtermcap.so.2()(64bit)                      YES (db provides)
D:  Requires: libzebra.so.0()(64bit)                        YES (added provide)
D:  Requires: rpmlib(CompressedFileNames) <= 3.0.4-1        YES (rpmlib provides)
D:  Requires: rpmlib(PayloadFilesHavePrefix) <= 4.0-1       YES (rpmlib provides)
D:  Requires: rtld(GNU_HASH)                                YES (db provides)
D: Conflicts: bird                                          NO 
D: Conflicts: gated                                         NO 
D: Conflicts: mrt                                           NO 
D: Conflicts: zebra                                         NO 
D: opening  db index       /var/lib/rpm/Conflictname rdonly mode=0x0
D: closed   db index       /var/lib/rpm/Depends
D: ========== recording tsort relations
D:  Requires: libospf.so.0()(64bit)                         YES (added provide)
D:  Requires: libospfapiclient.so.0()(64bit)                YES (added provide)
D:  Requires: libzebra.so.0()(64bit)                        YES (added provide)
D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth, breadth)
D:     0    0    0    0    1    0   +quagga-0.98.6-11.el5.x86_64
D: installing binary packages
D: closed   db index       /var/lib/rpm/Pubkeys
D: closed   db index       /var/lib/rpm/Conflictname
D: closed   db index       /var/lib/rpm/Providename
D: closed   db index       /var/lib/rpm/Basenames
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages
D: opening  db environment /var/lib/rpm/Packages joinenv
D: opening  db index       /var/lib/rpm/Packages create mode=0x42
D: mounted filesystems:
D:     i        dev    bsize       bavail       iavail mount point
D:     0 0x00000802     4096     53388827     60616625 /
D:     1 0x00000003     4096            0           -1 /proc
D:     2 0x00000000     4096            0           -1 /sys
D:     3 0x0000000c     4096            0           -1 /dev/pts
D:     4 0x00000801     1024       455275       128484 /boot
D:     5 0x00000013     4096       496282       496281 /dev/shm
D:     6 0x00000014     4096            0           -1 /proc/sys/fs/binfmt_misc
D:     7 0x00000015     4096            0           -1 /var/lib/nfs/rpc_pipefs
D: sanity checking 1 elements
D: opening  db index       /var/lib/rpm/Name create mode=0x42
D: running pre-transaction scripts
D: computing 73 file fingerprints
Preparing...                D: computing file dispositions
D: opening  db index       /var/lib/rpm/Basenames create mode=0x42
########################################### [100%]
D: ========== +++ quagga-0.98.6-11.el5 x86_64-linux 0x2
D: Expected size:      1181289 = lead(96)+sigs(344)+pad(0)+data(1180849)
D:   Actual size:      1181289
D: quagga-0.98.6-11.el5: Header V3 DSA signature: OK, key ID e8562897
D:   install: quagga-0.98.6-11.el5 has 73 files, test = 0
D: opening  db index       /var/lib/rpm/Triggername create mode=0x42
D:   install: %pre(quagga-0.98.6-11.el5.x86_64) asynchronous scriptlet start
D:   install: %pre(quagga-0.98.6-11.el5.x86_64)    execv(/bin/sh) pid 4202
+ groupadd -g 85 -r quaggavt
D:   install: waitpid(4202) rc 4202 status 2 secs 44.222
error: %pre(quagga-0.98.6-11.el5.x86_64) scriptlet failed, signal 2
error:   install: %pre scriptlet failed (2), skipping quagga-0.98.6-11.el5
D: running post-transaction scripts
D: closed   db index       /var/lib/rpm/Triggername
D: closed   db index       /var/lib/rpm/Basenames
D: closed   db index       /var/lib/rpm/Name
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages
D: May free Score board((nil))
[::root@test /var/tmp]#











If you look at the above logs the rpm was stuck while doing the + groupadd -g 85 -r quaggavt command
When i try running the command separetly it was stuck in the same position.
hence i checked the /etc/nsswitch.conf file for any authentication issue.
and then i found that the /etc/nsswitch.conf has a ldap configuration and the ldap server was not reachable due to that the groupadd command was not working.
Removed the ldap configuration form the /etc/nsswitch.conf and i was able to install the quagga rpm successfully.