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 Yum Install -y Vnstat
Ubuntu installation
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