How can I find out which process uses my internet with NetHogs?

2

Even when I'm not using my internet connection, I see varying network usage in the network monitor applet in Fedora 14. So I decided to use nethogs to monitor process IDs of the involved processes.

I fail to comprehend which process/service/application is trying to access the internet/network on my WiFi.

Here's a screenshot of nethogs:

Image

I understand that Firefox is in there, as I was using it when taking the screenshot, but what do the first two or three lines mean in the PROGRAM field, with data rates 0.015 and 0.013 KB/sec?

Karan

Posted 2011-10-09T07:46:12.687

Reputation: 175

Well, the first connection is from a highport to a highport by the look of it, which is often a signature of a game or torrent. But the pid is 0, which can't be right. Did you try running as root to see if you get a meaningful pid (>1) – Paul – 2011-10-09T11:27:30.673

@Paul I always get PID=0 regardless of the process i run. – Karan – 2012-09-28T05:39:34.233

I meant that in order for nethogs to be able to read the PID of processes other than of the user running nethogs, it needs to be run as root. For an ordinary user they will show as PID=0. For example, the above seems be being run by karen. Or try sudo netstat -pant from a command line to see the PID. – Paul – 2012-09-28T05:45:22.240

Answers

1

Non-root users are not permitted to see the name of the program that opened a network connection, or its process ID, so nethogs displays the details of the connection itself as a fallback. The field, however, is not wide enough to display everything, so you are seeing only the right-hand side of it. That's about enough space to display the local port, remote IP address and remote port. If you actually run nethogs as root, you should get more information.

Michael Hampton

Posted 2011-10-09T07:46:12.687

Reputation: 11 744

By default, nethogs requires to be run as root. So the screenshot posted above is nethogs running with root credentials. – Karan – 2013-03-01T13:37:01.000