Super easy to use Linux system query network card and other traffic parameters of the tool, share to everyone!!!

Source: Internet
Author: User

Super easy to use Linux system query network card and other traffic parameters of the tool, share to everyone!!!

At work, you may encounter this kind of situation: managed server traffic exceeded the limit, but suddenly can not be like Windows host through the QQ Butler or 360 Guardian and other software tools as very intuitive to detect the server's real-time network card import and export traffic, then the benefits come!

Linux View network card traffic six ways (I use the CentOS 6.4 system)

Method One, Nload tools

wget http://heanet.dl.sourceforge.net/project/nload/nload/0.7.2/nload-0.7.2.tar.gz

To view the Parameters help command:
Nload–help

-A: This seems to be the total data refresh time period, the unit is the second, the default is 300. 
-i: The display scale maximum setting of the traffic graph entering the network card, the default 10240 kBit /S. 
-m: No traffic graph is displayed, only statistics are displayed.  
-o: Go out the display scale maximum setting of the traffic graph of the NIC, default 10240 kbit/s. 
-t: Displays the refresh interval of the data, in milliseconds, by default 500.  
-u: Sets the data units for the right Curr, AVG, Min, Max, which are automatically changed by default. Note The case is different!  
h|b|k|m|g    H:auto, b:bit/s, k:kbit/s, m:mbit/s etc.  
h| b| k| m| g    H:auto, b:byte/s, k:kbyte/s, m:mbyte/s etc. 
- U: Sets the data unit of the right TTL, which is automatically changed by default. Note The case units are different (same as-u)!  
devices: Custom monitoring of the network card, the default is all monitoring, using the left and right keys to switch.  
 

If only monitor eth0 command: nload eth0

Monitor all network cards: nload-m

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6C/D5/wKiom1VTEN6TaYtKAALOzQ4qwjE177.jpg "title=" nload " alt= "Wkiom1vten6taytkaalozq4qwje177.jpg"/>

Method Two, Iftop tools

wget http://www.ex-parrot.com/%7Epdw/iftop/download/iftop-0.17.tar.gz


1, Iftop interface related instructions

The interface above shows a scale range similar to that of the scale, which is used as a ruler for the bar showing the flow graph.
The <= in the middle and the two left and right arrows indicate the direction of the flow.

TX: Send Traffic
RX: Receive Traffic
Total: Overall flow
Cumm: Total traffic running iftop to current time
Peak: Traffic Peaks
Rates: Represents the average traffic for the past 2s 10s 40s, respectively

2, Iftop related parameters

Common parameters

-I set the monitoring network card, such as: # Iftop-i eth1
- b displays traffic in bytes (default is bits), such as: # Iftop-b
-N Causes the host information to display IP directly by default, such as: # Iftop-n
-N causes port information to be displayed by default directly, such as: # Iftop-n
-F shows incoming and outgoing traffic for a specific segment, such as # iftop-f 10.10.1.0/24 or # iftop-f 10.10.1.0/255.255.255.0
- H (Display this message), Help, display parameter information
- p after using this parameter, the middle list shows the local host information, and the IP information outside of this machine appears;
- B to display the flow graph bar by default;
- F This is not very likely to use, filter the calculation of the packet;
- p enables host information and port information to be displayed by default;
- m sets the maximum value of the top-most scale of the interface, with a scale of five large segments, for example: # iftop-m 100M
some operation commands after entering the Iftop screen (note case)
Press H to toggle whether help is displayed;
Press N to toggle the display of the IP or host name of the machine;
Press S to toggle whether the host information of the machine is displayed;
Press D to toggle whether the host information of the remote target hosts is displayed;
Press T to toggle the display format to 2 lines/1 lines/Only send traffic/show receive traffic only;
Press N to toggle display port number or port service name;
Press S to toggle whether to display the port information of the machine;
Press D to toggle whether the port information of the remote target host is displayed;
Press p to toggle whether the port information is displayed;
Press P to toggle pause/resume display;
Press B to toggle whether the average flow graph bar is displayed;
the average flow in 2 seconds or 10 seconds or 40 seconds is calculated by B switch;
Press T to toggle whether the total traffic for each connection is displayed;
Press L to turn on the screen filtering function, enter the characters to filter, such as IP, press ENTER, the screen will only show this IP-related traffic information;
Press L to toggle the scale on the top of the display screen, and the flow graph bar will change depending on the scale ;
Press J or press K to scroll up or down the screen to display the connection record;
Press 1 or 2 or 3 to sort by the three-column traffic data displayed on the right;
Sort by < According to the native name or IP on the left;
Sort by > According to the host name or IP of the remote target host;
Press O to toggle whether the current connection is fixed only;
Press F to edit the filter code, this is translated by the saying, I have not used this!
You can use the shell command, this is useless! I don't know what the order is.
Press Q to exit the monitor.

Method Three, Ifstat

wget http://gael.roualland.free.fr/ifstat/ifstat-1.1.tar.gz

Parameters:

-A monitors the status information of all network interfaces that can be detected
-Z Hidden traffic is an interface that is not available, for example those interfaces that have started but are not used
-i specifies the interface to be monitored, followed by the network interface name
Time:
-T reports full bandwidth for all monitoring interfaces
-W automatically enlarges the column width with the specified column width instead of adapting to the length of the interface name
-W If the content is wider than the width of the terminal window, wrap it automatically.
-B display bandwidth instead of KBYTES/S with KBITS/S


Method Four, Iptraf

Yum- y install Iptraf

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "spacer.gif" border= "0"/>650) this.width= 650, "src=" http://s3.51cto.com/wyfs02/M00/6C/D5/wKiom1VTERyAs_sZAAZyLkqShx8667.jpg "style=" float:left; "title=" Iptraf "alt=" wkiom1vteryas_szaazylkqshx8667.jpg "/>

method Five, Watch Ifconfig

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6C/D0/wKioL1VTEsrx3UumAAN8zqJ9HjE210.jpg "style=" float: Left, "title=" Watch "alt=" wkiol1vtesrx3uumaan8zqj9hje210.jpg "/>650" this.width=650; "src="/e/u261/themes/ Default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/images/localimage.png") no-repeat Center; border:1px solid #ddd; "alt=" spacer.gif "border=" 0 "/>
Method VI,

Watch Cat/proc/net/dev

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "spacer.gif" border= "0"/>650) this.width= 650, "src=" Http://s3.51cto.com/wyfs02/M02/6C/D5/wKiom1VTEgyhDeR5AAErSIiRRmc210.jpg "title=" 573e3d5e-c500-470b-9fc2-7d136d7b2de1.png "alt=" wkiom1vtegyhder5aaersiirrmc210.jpg "/>

Hope to be helpful to everyone, Thanks your read!

This article from "Dawn" blog, reproduced please contact the author!

Super easy to use Linux system query network card and other traffic parameters of the tool, share to everyone!!!

Related Article

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.