How to Setup NetHogs – Monitor Bandwidth Usage Per Process in Linux

NetHogs is a opensource tools to monitor network bandwidth that was used by the process and program in linux operating system. NetHogs does not rely on a special kernel module to be loaded. When you hit the high network traffic issue on your linux server, you can immediately find which PID is causing the issue. NetHogs will give you real time statistics of your network bandwidth of per process usage. Follow this steps to install NetHogs on linux CentOS 6.5 and the sample nethogs usage.

READ  How to Setup Samba SWAT on CentOS 6.5

1. Prepare additional repository (EPEL repository).

2. Install nethogs :

[root@oss ~]# yum install nethogs -y

3. NetHogs utility :

[root@oss ~]# nethogs

Sample output :
setup nethogs -1

4. NetHogs command option :
There are a few commad options when using nethogs. Using ‘-d‘ to add a refresh rate. As an example, to set 5 seconds as your refresh rate, then type the command as.

[root@oss ~]# nethogs -d 5

Other options :

-d     delay for refresh rate.
-h     display available commands usage.
-p     sniff in promiscious mode (not recommended).
-t     tracemode.
-V     prints Version info.

5. Monitor specific device (eth0 or eth1) network bandwidth only :

READ  How to Get Kernel Version, Kernel Release, Processor type and Hardware Platform On Linux

a) Monitor eth0 bandwidth :

[root@oss ~]# nethogs eth0

a) Monitor eth0 and eth1 bandwidth :

[root@oss ~]# nethogs eth0 eth1

Reference :

Leave a Reply

Your email address will not be published. Required fields are marked *

A world leading hosting company that provides fully-managed innovative and secure solutions, suitable for hosting small to medium-sized websites

Built on the best available technologies combined with Google Cloud for strong redundancy and application availability. Backed by skilled experts to address web security threats, a devops team to create advanced custom security solutions, and 24/7 sysadmins to watch over the platform. This powerful, hands-on approach makes your sites faster, safer, and easier to manage. Starting from only $3.95/mo.


* up to 30 days money back guarantee