CentOS / RHEL: Install vnStat Network Traffic Monitor To Keep a Log Of Daily Traffic
To install vnStat, a network traffic monitor, on CentOS or RHEL, you can use the following steps:
- Install the vnstat package:
sudo yum install vnstat- Start the vnstat daemon and enable it to start automatically at boot time:
sudo systemctl start vnstatrnsudo systemctl enable vnstat- Create a database for the desired network interfaces:
sudo vnstat --create -i <interface>Replace <interface> with the name of the interface you want to monitor (e.g., eth0).
- Check the vnstat status:
sudo vnstat -u- Display the current network traffic statistics:
sudo vnstatBy default, vnStat keeps a log of daily traffic. You can display the traffic statistics for specific days, months, or years by using the vnstat command with the appropriate options.
