raspi: log network traffic (vnstat)
to monitor the network traffic one can use the tool vnstat
- install vnstat
- setup database for interface: vnstat -u -i eth0
- start/enable service
- usage: update database: vnstat -u
- usage: query database: vnstat -q
troubleshooting: when systemctl status shows that database couldnt be created, just do this:
sudo chown -R vnstat:vnstat /var/lib/vnstat
source: wiki.archlinux.org