revlis.nl
Stash of notes about OSS, OSes, devops, virtualization, programming (hobby) projects &c
January 22, 2021 — 16:58
You might have used vnstat to view monthly traffic statistics in CLI, e.g. vnstat -i eth0 -m
. But if you’re like me you might also not have followed the project for a few years and know there’s now JSON output available (--json
) and there is vnstati
to output to PNG images.
Oneliner to output all possible stats:
inf="eth0"
for i in h d m t s hs vs; do
vnstati -i $inf -${i} -o vnstati-$i.png
done
More info:
- Homepage: https://humdi.net/vnstat
- Git: https://github.com/vergoh/vnstat
- Traffic Limit: https://github.com/mkorthof/traflimit