Nethogs-Network traffic monitoring tool

Source: Internet
Author: User

There are many open-source network monitoring tools available on the web for Linux operating systems. For example:

You can use the command iftop to check bandwidth usage, netstat to view interface statistics reports, and other tools BANDWIDTHD, speedometer, nethogs, Darkstat, Jnettop, Ifstat, Iptraf, Nload and ntop and so on.

But these tools are statistical card access data, if you want to find a like 360 security guard on Windows, can be in real-time statistics per program network bandwidth utilization, then nethogs is the only tool you need.

Top can view the CPU, memory and other information that the process consumes, and can monitor which processes occupy the maximum CPU and memory at any time. Nethogs can be said to be the network bandwidth top, he can see the process occupied by the bandwidth information, like top, refresh at any time.

Nethogs is a network traffic monitoring tool under the terminal, which differs from other statistics and monitoring network card traffic tools, in particular, it is possible to monitor the bandwidth consumption of each process, so that more intuitive access to network usage. It supports IPV4 and IPV6 protocols, supports local network cards, and PPP links. If a network block occurs, you can start nethogs immediately to see which PID is causing the condition. This makes it easy to figure out which program is running and suddenly takes up your bandwidth.


First, download the installation

wget Http://jaist.dl.sourceforge.net/project/nethogs/nethogs/0.8/nethogs-0.8.0.tar.gz-P/USR/LOCAL/SRC

Yum install-y gcc gcc-c++ libpcap libpcap-devel

Cd/usr/local/src

Tar XF nethogs-0.8.0.tar.gz

CD Nethogs

Make && make install


Ii. usage of Nethogs

nethogs [option] [device (s)]

The program requires root permissions, the default is to monitor the Eth0 network card, so the direct input sudo nethogs can also, if there are multiple network adapters, you must specify.

# Nethogs
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/40/BF/wKioL1PPVznTjow-AACpAxhkuUA526.jpg "style=" width : 700px;height:162px; "title=" 1.jpg "width=" "height=" 162 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiol1ppvzntjow-aacpaxhkuua526.jpg "/>

As shown, the Send and received columns show traffic statistics per process. The total data bandwidth is at the bottom, and sorting can be controlled with interactive commands.


Three, nethogs command line parameters

The following is the Nethogs command line parameter, with '-d ' to add the refresh frequency parameter, ' device name ' is used to detect the bandwidth of a given or some device (default is eth0). For example: To set the refresh rate for 5 seconds, type the following command:

# nethogs-d 5


If only the network bandwidth used to monitor the device (eth0) can use the following command:

# nethogs Eth0


If you want to monitor both the eth0 and ETH1 interfaces, use the following command:

# nethogs Eth0 eth1


Additional parameters and usage:

-d:delay for Refresh Rate,default is 1.

-h:display available commands usage.

-p:sniff in promiscious mode (not recommended).

-t:tracemode.

-b:bughunt mode-implies TraceMode.

-v:prints Version Info.

Nethogs Interactive Control

Here are some useful interactive controls for Nethogs (keyboard shortcuts):

M cycle between display modes (KB/S, KB, b, MB)

R sort by ' received '

s sort by ' sent '

Q quit

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/40/BF/wKioL1PPV6TiyzAfAACsLJNB3u0570.jpg "style=" width : 700px;height:143px; "title=" 2.jpg "width=" "height=" 143 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiol1ppv6tiyzafaacsljnb3u0570.jpg "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/40/C0/wKiom1PPVouwC7vmAACpwxJTTMA806.jpg "style=" width : 700px;height:141px; "title=" 3.jpg "width=" "height=" 141 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiom1ppvouwc7vmaacpwxjttma806.jpg "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/40/C0/wKiom1PPVouS1Fl5AACLyPUfFTY426.jpg "style=" width : 700px;height:139px; "title=" 4.jpg "width=" "height=" 139 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiom1ppvous1fl5aaclypuffty426.jpg "/>


This article is from the "Vfast_gongyijie" blog, make sure to keep this source http://952259538.blog.51cto.com/6841773/1445107

Nethogs-Network traffic monitoring tool

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.