How to track total data consumption?? reddit / selfhosted ---------------------------------------------------------------------- aksharatg 路 2023-10-24 05:27 Hello Selfhosters!!, I am using Raspberry Pi to selfhost many things and looking for ways to track my data usage (what is the total transfer over period of months). So that I can choose right plan for my broadband connection. Appreciate your help. ---------------------------------------------------------------------- thekrautboy 路 2023-10-24 05:44 https://github.com/vergoh/vnstat-docker ---------------------------------------------------------------------- youmeiknow 路 2023-10-24 05:47 I am wondering how to use it exactly... 馃 Say I have a host server and it has multiple VMs running through proxmox. I believe this need to be running on host serve to get the stats for the whole host server , isnt it? If so, there should be a docker installed. Not a prob, but just making sure if there is any other better way? ---------------------------------------------------------------------- thekrautboy 路 2023-10-24 05:52 If you would be running LXC or Docker containers you could probably give the vnstat container access to other interfaces and it could monitor them then. But with VMs thats not exactly possible so it cannot monitor those. If you run vnstat directly on the host then of course it can monitor all host interfaces, including any VM traffic that goes through there. vnstat doesnt only exist as Docker image, you can also install it "normally", check the Github. ---------------------------------------------------------------------- youmeiknow 路 2023-10-24 06:05 Thanks, I was just thinking if what I thought was correct or not.. 馃檪 ---------------------------------------------------------------------- ttkciar 路 2023-10-24 06:40 I just have a cron job that runs "ifconfig | logger" once a week. When I want to know how much data has been sent or received, I subtract the RX bytes or TX bytes from the appropriately timestamped entries and divide by the time difference. Easy-peasy. ---------------------------------------------------------------------- thekrautboy 路 2023-10-24 10:26 just fyi, [vnstat](https://github.com/vergoh/vnstat) can do all that from the cli too. Example `vnstat -5 -i enp3s0` enp3s0 / 5 minute time rx | tx | total | avg. rate ------------------------+-------------+-------------+--------------- 2023-10-24 12:15 4.93 KiB | 1.99 KiB | 6.92 KiB | 188 bit/s 12:20 1.59 MiB | 432.46 KiB | 2.01 MiB | 56.27 kbit/s ------------------------+-------------+-------------+--------------- ---------------------------------------------------------------------- rjames24000 路 2023-10-24 12:29 i just got a nethate sg3100 pfsense router .. i gotta figure out how to use this think so i can track all the data ---------------------------------------------------------------------- thekrautboy 路 2023-10-24 12:33 pfSense sure can output basic SNMP but i would imagine plugins for Prometheus or other stuff also exists. Simply ask /r/pfSense ---------------------------------------------------------------------- aksharatg 路 2023-10-24 16:57 Thank you, Thank you, Thank you so much u/thekrautboy vnStat seems to serve my need. I have installed using docker. Seems very light weight. Thanks again. ---------------------------------------------------------------------- thekrautboy 路 2023-10-24 17:02 Youre welcome :)