In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "what are the network monitoring tools commonly used in Linux". The editor shows you the operation process through actual cases, and the operation method is simple, fast and practical. I hope this article "what network monitoring tools are commonly used in Linux" can help you solve the problem.
Iftop
The admirable iftop can listen on the network interface you specify and present it in the style of top.
This is a good gadget that can be used to find out network congestion, measure speed and maintain the total amount of network traffic. It's often amazing to see how much bandwidth you're using, especially for those of us who still remember phone lines, modems, "high speeds" to amazing kb and real-time baud rates. We stopped using the baud rate a long time ago and fell in love with the bit rate. The baud rate is used to measure signal changes, although sometimes the same as the bit rate, but in most cases this is not the case.
If you have only one network interface, just run iftop directly. However, iftop requires root permission:
$sudo iftop
If you have more than one network interface, specify the interface you want to monitor:
$sudo iftop-I wlan0
Just like the top command, you can change the display options while the command is running:
H switch the help interface. N whether to resolve the domain name. S toggles the display of the source address, and d switches the display of the destination address. Whether S displays the port number. Whether N resolves the port; if parsing is turned off, the port number is displayed. T toggles the text display interface. The default display method requires ncurses. I personally think that the display of figure 1 is better organized and readable. P pauses the display of updates. Q exit the program.
Figure 1: well-organized and readable text display.
When you switch display settings, iftop does not interrupt monitoring traffic. Of course, you can also monitor a mainframe separately. This requires the IP address and subnet mask of the host. Now, I wonder how much load Pandora can put on my meagre bandwidth. So I first use the dig command to find their IP address:
$dig A pandora.com [...]; ANSWER SECTION:pandora.com. 267 IN A 208.85.40.20pandora.com. 267 IN A 208.85.40.50
What about the subnet mask? Ipcalc will tell us:
$ipcalc-b 208.85.40.20Address: 208.85.40.20 Netmask: 255.255.255.0 = 24Wildcard: 0.0.0.255 = > Network: 208.85.40.0
Now, provide the IP address and subnet mask to iftop:
$sudo iftop-F 208.85.40.20max 24-I wlan0
It's great, isn't it? And I was surprised to find that Pandora uses 500kb about every hour on my network. And like most streaming services, Pandora traffic is growing rapidly and stabilizing by caching.
You can use the-G option to do the same for the IPv6 address. Checking out the friendly man can help you understand other features of iftop, including customizing your default options using personal profiles, and using custom filtering (see PCAP-FILTER for filtering guides).
Nethogs
Nethogs is a quick and easy way to find out who is absorbing your bandwidth quickly. You need to run as root and specify the interface to listen on. It will show you a large number of applications and their process numbers, so you can kill any process if you want.
$sudo nethogs wlan0nethogs version 0.8.1PID USER PROGRAM DEV SENT RECEIVED 7690 carla / usr/lib/firefox wlan0 12.494 556.580 KB/sec5648 carla... / chromium-browser wlan0 0.052 0.038 KB/secTOTAL 12.546 556.618 KB/sec
Nethogs doesn't have many options: loop between kb/s, kb, b, and mb, sort by packets received and sent, and adjust refresh latency. See man nethogs for details, or run nethogs-h.
Vnstat
Vnstat is the easiest to use network data collection tool. It is very lightweight and does not require root permissions. It runs in the background as a daemon, so you can record your network data in real time. A single vnstat command can display the accumulated data.
$vnstat-I wlan0Database updated: Tue Oct 17 08:36:38 2017 wlan0 since 10 MiB monthly rx 2017 rx: 45.27 MiB tx: 3.77 MiB total: 49.04 MiB monthly rx | tx | total | avg. Rate-+-Oct'17 45.27 MiB | 3.77 MiB | 49.04 MiB | 0.28 kbit/s- -+-estimated 85 MiB | 5 MiB | 90 MiB | daily rx | tx | total | avg. Rate-+-today 45.27 MiB | 3.77 MiB | 49.04 MiB | 12.96 kbit/s- -+-estimated 125 MiB | 8 MiB | 133 MiB |
By default, it displays all network interfaces. Use the-I option to select an interface. You can also merge data from multiple interfaces like this:
$vnstat-I wlan0+eth0+eth2
You can filter the data display in these ways:
-h displays statistics by hour. -d displays statistics by day.-w and-m display statistics by week and month, respectively. Use the-l option to view live updates.
The following command will delete wlan1's database and no longer monitor it:
$vnstat-I wlan1-- delete
The following command will create an alias for one of your network interfaces. This example uses a wired interface name of Ubuntu 16.04:
$vnstat-u-I enp0s25-- nick eth0
By default, vnstat monitors eth0. You can modify it in / etc/vnstat.conf, or create your own personal profile in your home directory. Please refer to man vnstat for a complete guide.
You can also install vnstati to create a simple color picture (figure 2):
This is the end of $vnstati-s-I wlx7cdd90a0a1c2-o vnstat.png on "what are the common network monitoring tools in Linux". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
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: 206
*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.