How to look at network traffic under Linux __linux

Source: Internet
Author: User
Tags web services disk usage
How to look at network traffic under Linux.

Under Windows, we can easily view the network traffic through 360来 and know which process is consuming more network bandwidth. It's very important for Web servers to see how traffic is under Linux.

The following blog here is a very careful introduction of Linux to see the flow of methods:

Linux various ways to view network card traffic http://jasonyong.blog.51cto.com/47753/174197

I used some of them, but also found some other information on the Internet, summarized as follows: 1. Using Iptraf

Iptraf is a text screen interface tool for real-time viewing of network traffic.

Some systems are not necessarily installed,

If it is RHEL, then go to find the installation disk iptraf*.rpm package installation;

If it is CentOS, then install it with Yum install-y Iptraf

Iptraf is a text full screen interface, the operation is relatively simple and clear. It is best to use putty to see, securecrt may display garbled.

It provides a number of statistical methods:

(1) IP traffic monitor

(2) General interface statistics

(3) Detailed interface statistics

If you follow the-b parameter, you can also perform in the background, saving the data to a file in the/var/log/iptraf directory.

2. Nload

is not a system-self-contained program.

3. Ifstat

is not a system-self-contained program.

4. Sar

If the system is not installed,

If it is RHEL, then go to the installation disk to find sysstat*.rpm package installation;

If it is CentOS, then use Yum install-y sysstat installation.

Http://www.turbolinux.com.cn/turbo/wiki/writes that Sysstat is a toolkit that contains several very useful system detection procedures, iostat,mpstat and SAR.
The kit is included on each version of the Turbolinux.
Iostat is used to output CPU,I/O system and partition statistics. Can be used to analyze disk I/O, bandwidth, and other information.
Mpstat the various statistics that are used to output CPUs. can be used to analyze the operation of the program in the kernel state and user state.
SAR is used to collect various state information of the system at regular intervals. Then the state of the system can be monitored at various points in time.

There are many uses for SAR, if you want to monitor network traffic, use the following command-line method:

Sar-n DEV interval Count

Where the interval is a statistical interval, in seconds, Count is a total number of times, and if 0 is constantly counted until Ctrl + C interrupts, the count is dropped.

For example: Sar-n DEV 1 4

For example: Sar-n DEV 10 0

Iface:lan interface
RXPCK/S: Packets Received per second
TXPCK/S: Packets Sent per second
rxbyt/s: Number of bytes received per second
txbyt/s: Number of bytes sent per second

The following information also describes other uses of SAR:

How to view network traffic and hard disk usage under Linux http://www.yesadmin.com/301/133723/index.html

5. Watch More/proc/net/dev

Not intuitive.

6. Watch Ifconfig

Not intuitive.

7. Iftop

is not a system-self-contained program.

8. MTR

MTR is also a text screen program that is installed using Yum install-y mtr.

Not carefully used.

9. ntop

Provides a web interface view. NTOP also supports the Windows platform.

The following information describes the installation of NTOP

Linux-based ntop installation configuration http://linuxtro.blog.51cto.com/1239505/292709

Interactive Encyclopedia wrote ntop is a tool to monitor network traffic, using NTOP display network is more intuitive and detailed than some other NMS software. NTOP can even list the network bandwidth utilization of each node's computer.

ntop is a flexible, full-featured tool for monitoring and resolving LAN problems. It also provides command-line input and web interfaces that can be applied to embedded Web services.

This tool should be pretty good.

tcpdump + command combination https://bbs.et8.net/bbs/showthread.php?t=674503 wrote tcpdump-i ETH0-NV > 111
#top10 IP
Cat 111|awk ' {print $} ' |cut-d '. "-f1-4|grep 192.168|sort|uniq-c|sort-rn|head

If tcpdump is not installed, install using Yum install-y tcpdump.

I didn't use it, and I didn't have a job to study it for the time being.

Vnstat.

A simple and practical statistic tool for network traffic http://wowubuntu.com/vnstat.html

Never used it before.

12. More

Please supplement the way you use to view/monitor network traffic.


Turn from: http://codingstandards.iteye.com/blog/1541817

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.