LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-25-2020, 02:44 AM   #1
peter7089
Member
 
Registered: May 2016
Distribution: MX Linux
Posts: 249

Rep: Reputation: Disabled
Tool that can show network statistic for each process?


I am looking for a command line tool that can show network statistic for each process. For example, i want to see for the last 24 hours how much traffic each process have received and sent. Is there such a tool?
 
Old 03-25-2020, 08:33 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,162

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
I don't know of any per-process counters or logging in the network stack. One thing you could do is to match specific ports of interest in iptables and capture its counters periodically.
 
Old 03-25-2020, 09:30 AM   #3
peter7089
Member
 
Registered: May 2016
Distribution: MX Linux
Posts: 249

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by smallpond View Post
I don't know of any per-process counters or logging in the network stack. One thing you could do is to match specific ports of interest in iptables and capture its counters periodically.
How can i do that? I am not very advanced linux user.
 
Old 03-28-2020, 07:12 AM   #4
Chuck56
Member
 
Registered: Dec 2006
Location: Colorado, USA
Distribution: Slackware
Posts: 930

Rep: Reputation: 480Reputation: 480Reputation: 480Reputation: 480Reputation: 480
Quote:
Originally Posted by peter7089 View Post
I am looking for a command line tool that can show network statistic for each process. For example, i want to see for the last 24 hours how much traffic each process have received and sent. Is there such a tool?
Check out: https://github.com/raboof/nethogs

Here's a review: https://www.tecmint.com/nethogs-moni...-in-real-time/

I don't use it but the reviews says it provides "real time statistics of your network bandwidth of per process usage".

Hope that helps!
 
Old 04-18-2020, 01:58 PM   #5
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Nethogs is like top in that it shows a realtime display with adjustable update time.
I suspect that it would be possible to capture the output into a log and then graph the usage.
It also seems likely that just setting the update period longer may do what is wanted.

I just installed it from my package manager (dnf) and it seems most of the distros actually have it there for quick install as well. The review posted led me to try the quick install instead of compiling from github.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Looking for a server-side statistic tool martvefun Linux - Server 2 12-17-2012 03:24 AM
statistic for process m1n Linux - Newbie 4 02-20-2009 01:43 AM
How do I identify what process are making up the WA statistic? MikeyCarter Linux - Software 5 12-24-2008 06:11 AM
Command to show each application/process memory usage and its total gn00kie Linux - Enterprise 2 09-21-2006 03:08 AM
Statistic MRTG wont show the graph vladimir-dk Linux - Software 4 08-02-2004 09:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration