Saturday 15 December 2012

Network Traffic Monitoring Tool

Network Traffic Monitoring  Tool:-
Monitoring Network Traffic:-
VNstat:-
VNstat is a console-based network traffic monitor for Linux and BSD that keeps a log of network traffic for the selected interface(s). It uses the network interface statistics provided by the kernel as information source. This means that VNstat won't actually be sniffing any traffic and also ensures light use of system resources. With VNstat you are able to keep a log of all incoming and outgoing traffic which will be logged by Minute,Hour,Day,Month,Year.

IPTraf:-
IPTraf is a console-based network statistics utility for Linux. It gathers a variety of figures such as TCP connection packet and byte counts, interface statistics and activity indicators, TCP/UDP traffic breakdowns, and LAN station packet and byte counts.

How to install these tools

CentOS/RHEL:-
Steps:-

 1)      Download the source and unpack the source:-
 [root@linuxnotes~] # cd

  [root@linuxnotes~] # wget http://humdi.net/vnstat/vnstat-1.11.tar.gz
2)      Extract vnstat -1.11
 [root@linuxnotes~] # tar -xvf  vnstat-1.11.tar.gz
3)      [root@linuxnotes~]  # ls
4)        [root@linuxnotes~] # cd vnstat-1.11
5)        [root@linuxnotes~] # ls
6)        [root@linuxnotes~] #  vi  INSTALL (Please  follow the all steps )
7)        [root@linuxnotes~] # make
8)        [root@linuxnotes~] # make install

**Note:- Now that the package is installed we need to make it start, and automatically restart on boot.


9)       [root@linuxnotes~] #  cp ~/vnstat-1.11/examples/init.d/redhat/vnstat /etc/init.d/vnstat
10)    [root@linuxnotes~] # chmod +x /etc/init.d/vnstat        
11)   [root@linuxnotes~] # /etc/init.d/vnstat status
12)   [root@linuxnotes~] #  /etc/init.d/vnstat start
13)    [root@linuxnotes~] # /etc/init.d/vnstat status
14)   [root@linuxnotes~]  # cd /etc/init.d/                                              
15)    [root@linuxnotes~] # chkconfig --add vnstat                                           // To add  vnstat in chkconfig
16)    [root@linuxnotes~]  # chkconfig vnstat on                                                 

Setup VNstat  monitoring  interfaces:- 

17  Public Interface
      [root@linuxnotes~] # vnstat -u -i eth0

18 # Private Interface
      [root@linuxnotes~] #  vnstat -u -i eth1

19  [root@localhost /]# yum search iptraf
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * atomic: www7.atomicorp.com
 * base: mirrors.hns.net.in
 * extras: mirrors.hns.net.in
 * updates: mirrors.hns.net.in
========================================================================= N/S Matched: iptraf ==========================================================================
iptraf.i686 : A console-based network monitoring utility

  Name and summary matches only, use "search all" for everything.

20 [root@linuxnotes~] # yum install iptraf.i686.

21 [root@linuxnotes~] #  vnstat

22 [root@linuxnotes~]  vnstat -h   

23 [root@linuxnotes~]  vnstat -m

24 [root@linuxnotes~] #  iptraf -g

Friday 14 December 2012

Mysql ERROR 1045 (28000) in centos


To resolve Mysql "ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) in Centos"

Please Refer the following Steps:-

Solution-:

 [root@linuxnotes~]# /etc/init.d/mysqld stop
 [root@linuxnotes~]# mysqld_safe --skip-grant-tables &
 [root@linuxnotes~]# mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD("newrootpassword") where User='root';
mysql> flush privileges;
mysql> quit

Note:-

Before restarting the mysql service first kill all mysqld related process and then start mysqld service.

 [root@linuxnotes~]# /etc/init.d/mysqld stop
 [root@linuxnotes~]# /etc/init.d/mysqld start