I've been using vnStat to monitor the ethernet interface on a Linux computer, but found that it includes all local traffic. I do many file transfers from within the subnet which far exceeds the Internet traffic, so I'm having trouble getting any long-term and accurate monitoring of Internet usage due to this.
I'm hoping to find a way to exclude any local traffic and just count the external (Internet) traffic for the past hour, day, and month.
The computer is headless and accessed over SSH, so only command-line tools can be used.
I also tried darkstat which allowed me to filter the traffic, but it only provided a web interface.
Any ideas on how I can achieve this? Any suggestions will be very much appreciated!
I've been thinking outside the square a bit and found a messy solution.
I looked at the HTML source that darkstat was generating and found that the graphs use an XML file. I was able to view this from command-line using curl:
This gives me an XML document with all the chart series data. I could parse this and create something a bit more readable. This method seems inefficient and overly complicated though.
Surely there's a nicer way! Any advice is appreciated.