- Advertisement -
VPS House Servers
VPS House Servers
VPS House Servers

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.
In this article we will show you how to install and use vnStat (Network Traffic Monitor) on RHEL/CentOS linux distribution.

vnstat features

  • quick and simple to install and get running
  • gathered statistics persists through system reboots
  • can monitor multiple interfaces at the same time
  • several output options
    • summary, hourly, daily, monthly, weekly, top 10 days
    • optional png image output (using libgd)
  • months can be configured to follow billing period
  • light, minimal resource usage
  • same low cpu usage regardless of traffic
  • can be used without root permissions

Install VnStat on RHEL/CentOS 6.x/7.x Linux

To start, you will need to enable the EPEL repositories for your version of Linux. To enable the EPEL repositories in CentOS/RHEL 6.x enter following command:

To enable the EPEL repositories in CentOS/RHEL 7.x enter following command:

- Advertisement -
VPS House Cloud Servers
VPS House Cloud Servers
VPS House Cloud Servers

Next, you can install VnStat as normal through yum.

Once installed, the default configuration will work for most people. The default will run on the eth0 interface. If you need to change the interfaces, you will need to edit two files. It’s self explanatory. Change the occurrences of eth0 to eth1 (or your choice of interface).

Next, we need to create the database where the data will be collected and stored. The command may generate an error. If it does, that’s fine. It is because the new file is created with ownership of the logged in user. We will fix this by running a chown on the file before starting the service.

That’s it. You’re ready to start the service and start collecting data.


How to use VnStat

Using VnStat command line utility you can view statistics on bandwidth on per day, per month and per hour basis. It also provides option to show statistics in real-time.

Show Statistics for a day

To see daily stats, enter:

vnstat-dialy

Show Statistics for a Month

To see monthly network stats, enter:

vnstat-month

Show Statistics for a weekly

To see weekly network stats, enter:

weekly-network-stats

Show Statistics for a Hour

To see hourly network stats, enter:

show-statistics-for-a-hour

Show top 10 network stats

To see top 10 network, stats:

top-10-network-stats

Show Statistics in Real Time

To see transfer rate in real time, enter:

That is all. Lots more information about the usage and options can be found out in the vnStat man page.

- Advertisement -

There are no comments yet

  • Hello, guest