In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces what are the efficient network monitoring commands under Linux. It is very detailed and has a certain reference value. Friends who are interested must read it!
It is an onerous task for system and network administrators to monitor and debug the performance of Linux system every day. It is not easy to monitor and keep the system up and running.
1. Nload
Nload is a command-line tool that allows users to monitor inbound and outbound traffic separately. It can also draw charts to show inbound and outbound traffic, and the view scale can be adjusted. It is easy to use and does not support many options.
So, if you only need to quickly check the total bandwidth usage without the details of each process, then nload is very convenient to use. The result is bit/s.
$nload
Installing nload:Fedora and Ubuntu has nload in the default software library. CentOS users need to obtain nload from the Epel software library.
2. Iftop
Iftop measures the data transmitted over each socket connection; it works differently from nload. Iftop uses the pcap library to capture packets going in and out of the network adapter, and then summarizes the packet size and number to figure out the overall bandwidth usage.
Although iftop reports the bandwidth used by each connection, it cannot report the name / number of processes participating in a socket connection (ID). However, because it is based on the pcap library, iftop can filter traffic and report the bandwidth usage of selected host connections specified by the filter.
$sudo iftop-n
The n option prevents iftop from parsing IP addresses into hostnames, which itself generates additional network traffic.
Users who install iftop:Ubuntu/Debian/Fedora can obtain it from the default software library. CentOS users can get it from Epel.
3. Iptraf
Iptraf is an interactive and colorful IP LAN monitoring tool. It can display the amount of data transferred between each connection and between hosts. Here is a screenshot.
$sudo iptraf4. Nethogs
Nethogs is a small "net top" tool that displays the bandwidth used by each process and sorts the list, ranking the processes that consume the most bandwidth at the top. In case of a sudden surge in bandwidth usage, users can quickly turn on nethogs and find the process that caused the surge in bandwidth usage. Nethogs can report the process number (PID), user, and path of the program.
$sudo nethogs
Users who install nethogs:Ubuntu, Debian, and Fedora are available from the default software library. CentOS users need Epel.
5. Bmon
Bmon (bandwidth Monitor) is a nload-like tool that displays the traffic load of all network interfaces on the system. The output also contains charts and profiles, with details at the packet level.
Install bmon:Ubuntu, Debian, and Fedora users can install from the default software library. CentOS users need to install repoforge because there is no bmon in Epel.
Bmon supports many options for producing reports in HTML format. For more information, see the reference manual page.
6. Slurm
Slurm is another network load monitor that can display device statistics and ASCII graphics. It supports three different types of graphics, each of which can be activated by using the c, s, and l keys. Slurm is simple and cannot display any further details about the network load.
$slurm-s-I eth07. Tcptrack
Tcptrack, similar to iftop, uses the pcap library to capture packets and calculate various statistics, such as the bandwidth used for each connection. It also supports standard pcap filters that can be used to monitor specific connections.
Installing tcptrack:Ubuntu, Debian, and Fedora has it in the default software library. CentOS users need to get it from RepoForge because it is not in Epel.
8. Vnstat
Vnstat is a little different from most other tools. It actually runs the background service / daemon, constantly recording the size of the data transferred. In addition, it can be used to produce reports showing the history of network usage.
$service vnstat status* vnStat daemon is running
Running vnstat with no options only shows the total amount of data transferred since the daemon ran.
$vnstatDatabase updated: Mon Mar 17 15:26:59 2014eth0 since 06/12/13rx: 135.14 GiB tx: 35.76 GiB total: 170.90 GiBmonthlyrx | tx | total | avg. Rate
-+-Feb '148.19 GiB | 2.08 GiB | 10.27 GiB | 35.60 kbit/sMar' 144.98 GiB | 1.52 GiB | 6.50 GiB | 37.93 kbit/s-+-estimated 9.28 GiB | 2.83 GiB | 12.11 GiB | dailyrx | tx | total | avg. Rate-+-yesterday 236.11 MiB | 98.61 MiB | 334.72 MiB | 31.74 kbit/stoday 128.55 MiB | 41.00 MiB | 169.56 MiB | 24.97 kbit/s-+-estimated 199 MiB | 63 MiB | 262MiB |
To monitor bandwidth usage in real time, use the "- l" option (real-time mode). It then displays the total amount of bandwidth used by the inbound and outbound data, but very accurately, without any internal details about the host connection or process.
$vnstat-l-I eno1Monitoring eth0... (press CTRL-C to stop) rx: 12 kbit/s 10 pacers tx: 12 kbit/s 11 pcanes
Vnstat is more like a tool for producing historical reports, showing how much bandwidth has been used each day or in the past month. It is not a strict tool for real-time monitoring of the network.
Vnstat supports many options, and see the reference manual page for details on which options are supported.
9. Bwm-ng
Bwm-ng (next Generation bandwidth Monitor) is another very simple real-time network load monitoring tool that reports summary information and shows the speed of different data going in and out of all available network interfaces on the system.
$bwm-ngbwm-ng v0.6 (probing every 0.500s), press 'h'for helpinput: / proc/net/dev type: rate/ iface Rx Tx Tot= eth0: 0.53KB/s 1.31 KB/s 1.84KB lo: 0.00KB / s 0.00KB / s 0.00KB---total: 0.53KB/s 1.31KB/s 1.84KB/s
If the console is large enough, bwm-ng can also use the curses2 output mode to draw a bar chart for traffic.
$bwm-ng-o curses210. Cbm:Color Bandwidth Meter
This is a small and simple bandwidth monitoring tool that can display the amount of traffic passing through various network interfaces. There is no further option, just to display and update traffic statistics in real time.
11. Speedometer
This is another small and simple tool that only draws good-looking graphics to show inbound and outbound traffic transmitted through an interface.
$speedometer-r eth0-t eth012. Pktstat
Pktstat can display all active connections in real time and show the speed at which data is transmitted through these active connections. It can also show the connection type, such as a TCP connection or a UDP connection, and, if a HTTP connection is involved, detailed information about the HTTP request.
$sudo pktstat-I eth0-nt13. Netwatch
Netwatch, which is part of the netdiag toollibrary, can also display connections between local hosts and other remote hosts, and show which data is transferred at a speed on each connection.
$sudo netwatch-e eth0-nt14. Trafshow
Like netwatch and pktstat, trafshow can report on currently active connections, the protocols they use, and the data transfer speed on each connection. It can filter connections using pcap type filters.
Monitor only TCP connections
$sudo trafshow-I eth0 tcp15. Netload
The netload command displays only a short report on the current traffic load and the total number of bytes transferred since the program started. There are no more features. It is part of netdiag.
$netload eth016. Ifstat
Ifstat can display network bandwidth in batch mode. The output is in a format that makes it easy for users to log and analyze using other programs or utilities.
$ifstat-t-I eth0 0.5Time eth0HH:MM:SS KB/s in KB/s out09:59:21 2.62 2.8009 Virtue 59 22 2.10 1.7809 Fraser 59 22 2.67 1.8409 Fraser 23 2.06 1.9809 Fraser 23 1.73 1.79
Users who install ifstat:Ubuntu, Debian, and Fedora have it in the default software library. CentOS users need to get it from Repoforge because it is not in Epel.
17. Dstat
Dstat is a versatile tool (written in Python) that can monitor different statistics of the system and report using batch mode, or record the relevant data in CSV or similar files. This example shows how to use dstat to report network bandwidth.
$dstat-nt-net/total- system--recv send | time0 0 | 23-03 10 Paradigm 27purl 131738B 1810B | 23-03 10Relay 27purl 142937B 2610B | 23-0310Relay 27Rich 152319B 2232B | 23-0310Vista 27purl 162738B 2508B | 23-0310purl 271718. Collectl
Collectl reports system statistics in a format similar to dstat; like dstat, it collects statistics about different resources of the system, such as processors, memory, networks, and so on. Here is a simple example of how to use collectl to report network usage / bandwidth.
$collectl-sn-oT-i0.5waiting for 0.5 second sample... # # Time KBIn PktIn KBOut PktOut10:32:01 40 58 43 6610:32:01 27 58 3 3210:32:02 3 28 9 4410:32:02 5 42 96 9610:32:03 5 48 32
The above is all the contents of the article "what are the efficient network monitoring commands under Linux". Thank you for reading! Hope to share the content to help you, more related knowledge, 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.