View your Traffic Quota with vnstat - Network monitoring

CentOS Nov 4, 2017

If you are running a virtual private server, you might be restricted by a bandwidth quota. To view your current traffic consumption, you can install a tool called vnstat.

What is vnstat for?

Most of your installed services on your virtual private server generate bandwidth traffic. You generally can distinguish the traffic in transmit tx and receive rx.

With vnstat, you can monitor all data by month, week, hour and day. It is also very lightweight in using system resources. So, the CPU and Memory usage is low.

How can I install this tool?

If you haven't already done, enable EPEL repositories on the CentOS host.

yum -y install epel-release && yum -y update

Use the following command to install vnstat

yum -y install vnstat

The next step is to register this tool as a service. The OS will execute the background task on every boot.

systemctl enable vnstat && systemctl start vnstat && chkconfig vnstat on

You are now ready to use it. Here are some useful examples:

#overview since start, monthly and daily
vnstat
 
#live transfer rate
vnstat -l
 
#overview monthly
vnstat -m
 
#overview last days
vnstat -d

You are finished with the installation of vnstat.


Tested on:

  • vnstat: 1.15

Credits:

Tags

Stefan

Howdy! I'm Stefan and I am the main author of this blog. If you want know more, you can check out the 'About me' page.

Impressum | Data Privacy Policy | Disclaimer
Copyright: The content is copyrighted and may not be reproduced on other websites without permission.