raboof / nethogs

Linux 'net top' tool
GNU General Public License v2.0
3.19k stars 289 forks source link

-P processID1 processID2 ... processIDn #276

Open JeckPeppinger opened 5 months ago

JeckPeppinger commented 5 months ago

nethog can be set on specific processes which is great. With -P a processID to monitor can be specified.

Is there a way to supply a list of processIDs to monitor?

Example cfommand: sudo nethogs -P pgrep rclone -v 3 When one rclone process is running, the command works well. But when there is more than one rclone process it fails, because pgrep rclone returns several pIDs. Is there a way to send a list if pIDs to -P?

JeckPeppinger commented 5 months ago

i made a small script for several processes, here it is rclone, change this to the app/process you want. note the -v 3 option switches to network usage - total in out traffic for this process. if you want momentar bandwidth usage check the -v options.

#!/usr/bin/bash

PROC=""

for i in `pgrep rclone` ; do
  PROC="$PROC -P $i"
done

# echo $PROC

sudo nethogs $PROC -v 3