How to use Vnstat to view server bandwidth traffic statistics under Linux

Source: Internet
Author: User

Because many VPS or server are limited traffic, but many service providers do not provide a detailed flow chart, such as daily traffic table, so it is certain that some people would like to know how much traffic on their servers.

Vnstat is a very useful server traffic statistics command. I'll get a few pictures to show you.

Statistics days and month of statistics:

is not very intuitive. Let's take a look at how this command is used. Estimated is the meaning of estimating usage. Last column Avg. Rate is the average bandwidth used. Rx is receive traffic (inbound), TX is send traffic (outbound)

First step: Install

CentOS needs to install Epel source before using Yum to install

Yum install epel-release-y && yum install-y vnstat

Ubuntu installation

Apt-get Install Vnstat

Step Two: Create a monitoring database

The eth0 here can be changed to the network card you need.

Vnstat-u-I. eth0

How to view network cards

Ifconfig

Step three: Start the service and set the boot up

Start the service and set the boot up

Service Vnstat Startchkconfig Vnstat on

Users unable to use Chkconfig

chmod +x/etc/rc.localvi/etc/rc.local

Join

Service Vnstat Start
Fourth step: Traffic View command

After all the above operations, after a 10 minutes or so (really don't worry.) You go to take a piece of crap, eat a meal, sleep, you should have something to read. You can use the command to see the data pull ...

Look at the Daily Traffic statistics command:

Vnstat-d

Look at the monthly traffic statistics command:

Vnstat-m

How to use Vnstat to view server bandwidth traffic statistics under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.