Score:0

Is there a way to monitor data transfer per port on ubuntu?

in flag

We are running a server process which has multiple active ports. I would like to know what outgoing data transfer is associated with each port. I would like to see a 24 hour report like:

  • port 30000 : 2.4G
  • port 30001 : 1.2G
  • port 30002 : 2.3G

Is there a way to do this?

djdomi avatar
za flag
Questions seeking installation, configuration or diagnostic help must include the desired end state, the specific problem or error, sufficient information about the configuration and environment to reproduce it, and attempted solutions. Questions without a clear problem statement are not useful to other readers and are unlikely to get good answers
Score:1
za flag

Basically you need a Netflow installation - a series of probes on the host that will collect the data about traffic passing and then pass it onto the collector (which may or may not reside on the same host), from which you can build your statistic reports. At the time of this writing the most up-to-date and functional netflow framework is nfdump. Since you're using Linux, the recommended probes would be ipt-netflow.

There's also a number of derivatives/alternatives worth to mention, like sFlow, but the most straightforward approach would be using Netflow.

Score:0
ae flag

You can use iftop to capture the network traffic data per port.

iftop has a text mode (iftop -t) that may be useful - see iftop - how to generate text file with its output?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.