Table of Contents
vnStat
is a tool used on Linux and BSD-based systems to monitor and report network traffic statistics. This tool collects, stores, and provides users with various statistics related to network traffic. Some key features of vnStat
include:
- Daily, Weekly, Monthly Reports:
vnStat
collects and reports network traffic statistics on a daily, weekly, and monthly basis. - Total Consumption Information: Displays the total amount of data sent and received.
- Visualization of Changes Over Time: Presents graphical representations of changes in network traffic over time.
- Lightweight and Efficient:
vnStat
is a lightweight tool that operates with low system resources and can run continuously in the background. - Compatibility with Various Interfaces: Supports various interfaces, including a Command Line Interface (CLI) and web-based interfaces.
Installing vnStat
:
Here are some basic commands to install vnStat
:
Debian/Ubuntu-Based Distributions (Using apt Package Management):
sudo apt update
sudo apt install vnstat
Red Hat/Fedora/CentOS-Based Distributions (Using yum or dnf Package Management):
sudo yum install vnstat
or
sudo dnf install vnstat
openSUSE-Based Distributions (Using zypper Package Management):
sudo zypper install vnstat
Once vnStat
is installed, you can use various commands to view network traffic statistics. For example:
- To view the daily report:
vnstat -d
- To view the weekly report:
vnstat -w
- To view the monthly report:
vnstat -m
These commands allow you to view network traffic statistics for specific time intervals.
vnStat
Cheat Sheet:
- Show Daily Statistics:
vnstat -d
- Displays daily network statistics.
- Show Weekly Statistics:
vnstat -w
- Displays weekly network statistics.
- Show Monthly Statistics:
vnstat -m
- Displays monthly network statistics.
- Show Total Summary:
vnstat -t
- Displays a total summary of network statistics.
- Live Monitoring:
vnstat -l
- Initiates live monitoring, continuously updating network statistics.
- Display Hours Distribution:
vnstat -h
- Shows the distribution of network usage over hours.
- Reset Statistics:
vnstat -r
- Resets the network statistics.
- Set Rate Unit:
vnstat -u
- Changes the rate unit (bits, bytes, kbit, etc.).
- Export Database:
vnstat -e
- Exports the database to a file.
- Clear Database:
vnstat --clear
- Clears all collected data.
- Help and Options:
vnstat --help
- Displays the help menu with available options.
These commands provide a quick reference for interacting with vnStat
and exploring various network statistics. Feel free to customize the commands based on your specific needs.