In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you what is the use of the nethogs command in Linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Linux common command NetHogs is an open source command line tool (similar to Linux's top command), which is used to calculate the network bandwidth utilization in real time by process or program.
Network Traffic Monitoring tool under nethogs Terminal
Add that there are many open source network monitoring tools for Linux systems. For example, you can use the command iftop to check bandwidth usage. Netstat is used to view interface statistics reports, and top monitors the current running process of the system. But if you're looking for a tool that can count network bandwidth utilization by process in real time, then NetHogs is worth a look.
From the NetHogs project website:
NetHogs is a small net top tool that groups bandwidth by process rather than slowing down each protocol or subnet as most tools do. NetHogs does not need to rely on loading a particular kernel module. If there is a network congestion, you can start NetHogs and immediately see which PID caused the situation. This makes it easy to find out which program ran away and suddenly took up your bandwidth.
This article shows you how to install and use NetHogs to monitor network bandwidth usage by process under the Unix/Linux operating system.
Syntax nethogs (option) (parameter) option usage: nethogs [- V] [- h] [- b] [- d seconds] [- v mode] [- c count] [- t] [- p] [- s] [device [device [device...]-V: print version. -h: print this help. -b: bughunt mode-implies tracemode. -d: delayed update refresh rate in seconds. The default value is 1. -v: view mode (0 = KB / MB 1 = total KB,2 = total BP3 = total MB). The default value is 0. -c: number of updates. The default is 0 (unlimited). -t: tracemode. -p: incite chaos mode (not recommended). -s: sorts the output by send column. -a: monitor all devices, even loopback / stop. Device: the device to be monitored. Default is all interfaces up and running, excluding loopback when nethogs is running, by: Q: exit s: sort by SENT traffic r: sort by RECEIVE traffic m: switch other parameters and usage between total (KB,B,MB) and KB / s mode
-d: refresh interval-h: help-p: promiscious mode-t: trace mode-V: version interactive command
Here are some interactive commands (keyboard shortcuts) for NetHogs
M: modify unit
R: sort by traffic
S: sort by send traffic
Q: exit command prompt
Install NetHogs under RHEL, CentOS, and Fedora
Yum install nethogs installs NetHogs under Ubuntu, Linux mint, and Debian
Type the apt-get command to install the NetHogs package:
For nethogs to execute NetHogs under Debian/Ubuntu/Linux Mint, you must have root permission:
NetHogs Preview under Ubuntu 12.10
As shown in the figure above, the end and received columns show statistics based on the traffic of each process. The total bandwidth of sending and receiving data is at the bottom, and sorting can be controlled with interactive commands, which are discussed below.
NetHogs command line parameters below are the parameters of the NetHogs command line, using-d to add the refresh frequency parameter, and device name is used to detect the bandwidth of a given device or devices (the default is eth0). For example, to set the refresh rate of 5 seconds, type the following command:
Nethogs-d 5$ sudo nethogs-d 5 if only used to monitor the network bandwidth of the device (eth0), you can use the following command:
Nethogs eth0 eth2 $sudo nethogs eth0 eth2 above is all the content of this article entitled "what is the use of nethogs commands in Linux?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more 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.