simple tool for monitoring cumulative bandwidth consumption in time intervals

Okay! This should be a pretty easy task, but for some reason I can't seem to figure out the right tool for the job.

I've got a simple network topology, with a small-ish number of hosts supported behind a gateway machine (running Debian 9.3) that NATs them. I want to find a tool that repeatedly monitors how much outside bandwidth each host behind the NAT is using in a time interval and logs it to a file. Sample output could be anything along the lines of "Jan 1 2018 10:00-10:20 - 203MB, - 400MB, etc. etc."

Some key points:

  • I'm not very picky as to the time interval, but would like it to be somewhat small to minimize the information lost in the event that the gateway crashes. The goal is for this device to be powering a network and running indefinitely.

  • Cumulative or non-cumulative values, either is fine for me. We'll just be reading this information and processing it into a simple web portal, so we can do whatever we have to.

  • If the tool needs to be restarted thats fine, if it just keeps dumping a logfile every so often that's fine too.
  • I'd like to be able to do basic filtering (i.e. I can tell it to not count the traffic between specific subnets, or mark that traffic separately).

So far I've looked at nettop (and nettop-ng), iftop, and a half-dozen other ISP monitoring/billing platforms but the command line tools don't seem to give me quite what I want, and the big platforms seem way too much for my needs, are somewhat expensive, and don't actually fit my bigger needs (we're building a private prepaid cellular network). I feel like there has to be a nice clean one-liner out there with some basic utility but I'm stumped. Thanks in advance for the help!!!