I have some processes in my unix system that sends data to a remote machine. It is possible to fetch the total bytes sent per pid ?
In general, how i can monitor that pid in terms of network?
Thank you
I have some processes in my unix system that sends data to a remote machine. It is possible to fetch the total bytes sent per pid ?
In general, how i can monitor that pid in terms of network?
Thank you
I suggest looking into nethogs.
From their Page:
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 identify programs that have gone wild and are suddenly taking up your bandwidth.
Try
sudo nethogs -av 3
-a
-v 3
See nethogs -h
for usage.
GET
to return the traffic data. PHP itself has nothing to call on the system to get a PID's traffic and the system isn't actively logging every PID's traffic without a reason to do so.
– devnull
Jan 29 '15 at 18:09
man procfs
and look forproc/pid/io
andproc/pid/net
– mikeserv Jan 28 '15 at 02:34