Home >System Tutorial >LINUX >Master Linux server traffic monitoring methods - yum and vnStat
For Linux server administrators, they must always keep track of the server's traffic and take appropriate measures to ensure the stability and security of the server. In terms of traffic monitoring, yum and vnStat are two very useful tools that can help us quickly and easily obtain and analyze the network traffic information of the server.
Because many vps or servers have limited traffic, but many service providers do not provide detailed traffic meters, such as daily traffic meters, so some people must want to know that the VPS server has finally run a lot of traffic. vnstat is a very useful server traffic statistics command.
Linux has two installation methods to view network card traffic through vnstat:
Yum installation or source code compilation and installation.
yum installation
Run directly
yum install vnstat -y
Test after installation:
[root@21yunwei ~]# vnstat -l -i eth0 Monitoring eth0... (press CTRL-C to stop) rx: 0 kbit/s 0 p/s tx: 0 kbit/s 0 p/s^C eth0 / traffic statistics rx | tx --------------------------------------+------------------ bytes 14.35 MiB | 13.87 MiB --------------------------------------+------------------ max 5.80 Mbit/s | 3.67 Mbit/s average 82.87 kbit/s | 80.08 kbit/s min 0 kbit/s | 0 kbit/s --------------------------------------+------------------ packets 16142 | 10523 --------------------------------------+------------------ max 626 p/s | 316 p/s average 11 p/s | 7 p/s min 0 p/s | 0 p/s --------------------------------------+------------------ time 23.65 minutes
Install vnstat using source code compilation
Applicable to situations where yum cannot be installed on individual systems.
wget http://humdi.net/vnstat/vnstat-1.10.tar.gz tar xvzf vnstat-1.10.tar.gz cd vnstat-1.10 make make install
After installation, the usage method is the same
In short, through the use of the two tools yum and vnStat, we can effectively monitor the network traffic of the Linux server, discover and solve problems in a timely manner, and ensure the normal operation of the server. Therefore, in order to better protect their servers, we strongly recommend that administrators master the use of these two tools and apply them in actual work.
The above is the detailed content of Master Linux server traffic monitoring methods - yum and vnStat. For more information, please follow other related articles on the PHP Chinese website!