Linux NetHogs monitoring tool introduction, linuxnethogs
NetHogs Introduction
NetHogs is an open-source, free network traffic monitoring tool for Linux processes or applications. NetHogs can only monitor the network bandwidth usage of processes in real time. NetHogs supports IPv4 and IPv6 protocols, and supports local NICs and PPP connections.
The official introduction is as follows:
NetHogs is a small 'net top' tool. instead of breaking the traffic down per protocol or per subnet, like most tools do, it groups bandwidth by process. netHogs does not rely on a special kernel module to be loaded. if there's suddenly a lot of network traffic, you can fire up NetHogs and immediately see which PID is causing this. this makes it easy to indentify programs that have gone wild and are suddenly taking up your bandwidth.
Download NetHogs
The open source code of NetHogs is provided for download on sourceforge. It only provides source code download. Http://sourceforge.net/projects/nethogs? Source = directory. If you need to download the RPM installation package, you can download it at this URL.
Install NetHogs in Ubuntu
Sudo apt-get install nethogs
Install NetHogs in ReadHat
[root@localhost tmp]# rpm -ivh nethogs-0.8.0-1.el6.x86_64.rpm
warning: nethogs-0.8.0-1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ########################################### [100%]
1:nethogs ########################################### [100%]
[root@localhost tmp]#
Source code Installation failed due to installation during the test process.
Use NetHogs
[Root @ localhost tmp] # nethogs
NetHogs provides interactive control commands:
M: Cycle between display modes (kb/s, kb, B, mb) switch the Network Speed display Unit
R: Sort by received ed. Sort by received traffic
S: Sort by sent. Sort by sent traffic
Q: Quit and return to the shell prompt. Exit the NetHogs command tool.
NetHogs command line parameters
Common parameters:
-D delay for refresh rate. The data refresh time, such as nethogs-d 1, is refresh once per second.
-H display available commands usage. displays the name help and usage information.
-P sniff in promiscious mode (not recommended ).
-T tracemode.
-V prints Version info.
Demo:
# Refresh data once every 5 seconds
Nethogs-d 5
# Monitor eth0 data of the NIC
Nethogs eth0
# Monitoring the eth0 and eth1 interfaces simultaneously
Nethogs eth0 eth1
# Write monitoring logs to log files
Nethogs> test. log
References:
Http://rpm.pbone.net/index.php3/stat/4/idpl/17273936/dir/redhat_el_6/com/nethogs-0.8.0-1.el6.x86_64.rpm.html
Http://sourceforge.net/projects/nethogs? Source = directory