lost and found ( for me ? )

CentOS6.5: monitor bandwidth with vnstat



# cat /etc/centos-release ;uname -ri
CentOS release 6.5 (Final)
2.6.32-431.3.1.el6.x86_64 x86_64


Add epel repo
# cat /etc/yum.repos.d/epel.repo
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6


[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1


[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1


Install vnstat via yum
# yum update -y
# yum install vnstat –y


config file
# less /etc/vnstat.conf
# vnStat 1.11 config file
##


# default interface
#Interface "eth0"
Interface "br0"


# location of the database directory
DatabaseDir "/var/lib/vnstat"


run vnstat as daemon.
# /etc/init.d/vnstat start
vnstatd を起動中:                                          [  OK  ]


# vnstat
Database updated: Tue Jan 14 15:33:21 2014


  br0 since 01/14/14


         rx:  10.46 MiB      tx:  14.21 MiB      total:  24.67 MiB


  monthly
                    rx      |     tx      |    total    |   avg. rate
    ------------------------+-------------+-------------+---------------
      Jan '14     10.46 MiB |   14.21 MiB |   24.67 MiB |    0.17 kbit/s
    ------------------------+-------------+-------------+---------------
    estimated        22 MiB |      31 MiB |      53 MiB |


  daily
                    rx      |     tx      |    total    |   avg. rate
    ------------------------+-------------+-------------+---------------
        today     10.46 MiB |   14.21 MiB |   24.67 MiB |    3.61 kbit/s
    ------------------------+-------------+-------------+---------------
    estimated        15 MiB |      21 MiB |      36 MiB |


dump bandwidth as graph
# vnstati -i br0 -vs -o hourly.png






It seems that vnstat can not output bandwidth consumption per port or IP addresses.

Anyway, this tool is easy to use to monitor total bandwidth.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.