VnStat Dashboard is a graphical web interface for VnStat, a network utility. VnStat dashboard provides a simple graphical chart where we can monitor the traffic of network interfaces. Dashboard also includes statistics history (hourly, days, months or full summary).
This post focuses on installing VnStat Dashboard on Linux systems.
Hourly statistics using Google Charts.
Daily and Monthly statistical overview.
Automatic population of network interfaces.
PHP and GD extension for PNG graphs.
VnStat is a command line tool to monitor the bandwidth of network interfaces and keeps a log of hourly, daily and monthly network traffic statistics on its database.
VnStat is not available on the main repository, so you need to enable EPEL repository for Redhat based derivatives.
Install VnStat using the following command.
Once the installation is complete, start VnStat using the following command. (Ignore if it is already running).
Set VnStat to autostart on system boot using the following command.
Please wait for some time, and then run the “vnstat” command. You should get similar output like below; this ensures that VnStat is working.
Install the apache and PHP extensions using “yum” on CentOS and “apt-get” on Debian/Ubuntu.
Configure the firewall to allow external machines to access the dashboard (CentOS / RHEL).
Download the latest version of VnStat Dashboard from the official GitHub.
Extract the downloaded package using “unzip” command.
Once the extraction is completed, plesae the files to web server (apache) root directory.
Open up the configuration file and modify the parameters shown like below.
Update the path of vnstat executable.
By default, VnStat Dashboard will display the statistics of all the interfaces. Set to true in case if you want to show the statistics of defined interfaces.
In our case, the dashboard will show statistics of “ens4 and eth1” only.
You can also name your network interfaces.
Open up your browser and navigate it to any one of the following URL You would get an output like below where you can get usage summary (in hours, days and months) of your network interface.
Note: If you don’t get any data in the graph, consider disabling SELinux on CentOS 7 / CentOS 6.