To install the vnStat
network traffic monitor on CentOS or RHEL, you can use the following steps:
vnStat
package using the yum
or dnf
package manager:sudo yum install vnstat
or
sudo dnf install vnstat
This will install the vnStat
package and all of the required dependencies.
vnStat
daemon by running the following command:sudo systemctl start vnstat
vnStat
starts automatically when the system boots, you can enable the vnStat
service by running the following command:sudo systemctl enable vnstat
vnstat
command with the -i
option and the name of the interface. For example:vnstat -i eth0
This will display the current traffic statistics for the eth0
interface.
vnstat
command with the -d
option and the name of the interface. For example:vnstat -d eth0
This will display a summary of daily traffic statistics for the eth0
interface.
vnstat
command with the -h
option and the name of the interface. For example:vnstat -h eth0
This will display a summary of hourly traffic statistics for the eth0
interface.
You can use the vnStat
command with different options to view various types of traffic statistics.