Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the ifstat command of Linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the Linux ifstat command how to use the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe you will have something to gain after reading this Linux ifstat command article, let's take a look.

Linux common command ifstat command, just like iostat/vmstat describes other system conditions, is a tool for counting the activity status of network interfaces.

Ifstat Statistics of Network Interface Traffic status

Add that the ifstat tool system is not installed by default, you need to download the source package, recompile and install it, and the process is relatively simple.

Download http://gael.roualland.free.fr/ifstat/ (official website) wget http://gael.roualland.free.fr/ifstat/ifstat-1.1.tar.gz compile and install tar-zxvf ifstat-1.1.tar.gz cd ifstat-1.1. / configure make make install # will be installed to / usr/local/bin/ directory by default Note: execute which ifstat output / usr/local/bin/ifstat

Option-l monitors the loop network interface (lo). By default, ifstat monitors all non-loop network interfaces for activity. After using, it is found that adding-l parameter can monitor all network interface information, not just lo interface information, that is to say, adding-l parameter will increase the status information of lo interface than not adding-l parameter. -a monitors the status information of all network interfaces that can be detected. Using discovery, there is one more plip0 interface information than adding the-l parameter. Search and find that this is a parallel port (there is a PLIP (Parallel Line Internet Protocol) in the network device. It provides parallel ports.)-z hides interfaces where traffic is not available, such as those interfaces that are enabled but not used-I specifies the interface to be monitored, followed by the network interface name-s equals to-d snmp: [comm@] [#] host [/ nn]] parameter, querying a remote host through SNMP-h to display short help information-n turns off displaying periodic header information (that is, When you run ifstat without the-n parameter, the name of the network interface will appear at the top. When it is not displayed on one screen, the name of the interface will appear again, indicating which network interface the traffic information is displayed. Add the-n parameter to turn off the periodic display interface name, showing it only once)-t adds a timestamp at the beginning of each line (can tell us the specific time)-T reports the full bandwidth of all monitoring interfaces (the last column has a total, showing in traffic for all interfaces and out traffic for all interfaces Simply add the in traffic of all interfaces, out traffic)-w with the specified column width, rather than automatically enlarge the column width to adapt to the length of the interface name-W automatically wrap if the content is wider than the width of the terminal window-S keeps status updates on the same line (no scrolling, no wrapping) Note: this is very convenient if you don't like screen scrolling. Similar to bmon display mode-b displays bandwidth in kbits/s instead of kbytes/s-Q quiet mode, warning message does not appear-v display version information-d specifies a driver to collect status information instance default use

[root@localhost ifstat-1.1] # ifstat eth0 eth2 KB/s in KB/s out KB/s in KB/s out 0.07 0.20 0.00 0.00 0.07 0.15 0.58 0.00 default ifstat does not monitor the loopback interface, and the traffic unit displayed is KB.

[root@localhost ifstat-1.1] # ifstat- tT time eth0 eth2 eth3 eth4 Total HH:MM:ss KB/s in KB/s out 16:53:04 0.84 0 . 62 1256.27 1173.05 0.12 0.18 0.00 0.00 1257.22 1173.86 16:53:05 0.57 0.40 0.57 0.76 0.00 0.00 0.00 1.14 1.17 16:53:06 1.58 0.71 0.42 0.78 0.00 0.00 0.00 2.01 1.48 16:53:07 0.57 0.40 1.91 2.61 0.00 0.00 0.00 2.48 3.01 16:53:08 0.73 0.40 924.02 1248.91 0.00 0.00 0. 00 924.76 1249.31 monitors all network interfaces

[root@localhost ifstat-1.1] # ifstat- a lo eth0 eth2 KB/s in KB/s out 0.00 0.00 0.28 0.58 0.06 0.06 0.00 0.00 1.41 1.13 0. 00 0.00 0.61 0.61 0.26 0.23 0.00 0.00 this is the end of the article on "how to use the ifstat command of Linux" Thank you for reading! I believe you all have a certain understanding of the knowledge of "how to use the ifstat command of Linux". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report