Saving bandwidth monitoring data to USB, higher frequency saving

Report issues relating to bandwith monitoring, bandwidth quotas or QoS in this forum.

Moderator: Moderators

Post Reply
staque
Posts: 5
Joined: Sat Jan 30, 2021 9:54 pm

Saving bandwidth monitoring data to USB, higher frequency saving

Post by staque »

Hi all, is there a way to get bandwidth monitoring data to save to an attached USB drive rather than the on-board flash memory? I would also like to get data saved more frequently in combination with writing to the USB drive. My understanding is data are only saved every four hours, with that frequency intended to preserve the life of the flash - however, I assume writing to a USB would make the external memory the disposable object which is easier to replace.

Lantis
Moderator
Posts: 6910
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Saving bandwidth monitoring data to USB, higher frequency saving

Post by Lantis »

It's not really configurable, but you could customise it yourself.
Is that something you're comfortable with and would like guidance on?
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

staque
Posts: 5
Joined: Sat Jan 30, 2021 9:54 pm

Re: Saving bandwidth monitoring data to USB, higher frequency saving

Post by staque »

My gut reaction is to say yes. It's hard to gauge without knowing how extensive the customization work would be, but I'm generally adventurous. Let's go for it!

Lantis
Moderator
Posts: 6910
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Saving bandwidth monitoring data to USB, higher frequency saving

Post by Lantis »

Alright, by no means a comprehensive guide.

/etc/init.d/bwmon-gargoyle
https://github.com/ericpaulbishop/gargo ... it#L20-L32
Those lines control where the backups will be read from for restoring into memory

https://github.com/ericpaulbishop/gargo ... it#L36-L38
Those lines control where the backups will be output to.

https://github.com/ericpaulbishop/gargo ... .init#L283
Controls how often the backup fires

You also need to make sure that the usb stick is available at boot before bwmon starts. As it currently stands it would attempt to start first. You might want to change its start order to 99 (last) and disable then enable the startup script so it relinks to the right spot.
https://github.com/ericpaulbishop/gargo ... nd.init#L2

If you wanted to backup quotas as well, that's a little more in-depth.
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

pkkrusty
Posts: 49
Joined: Mon Jan 13, 2020 4:41 pm

Re: Saving bandwidth monitoring data to USB, higher frequency saving

Post by pkkrusty »

Did you make any progress on this? I ask because I had issues with my main router a few months ago and ended up having to replace it. The symptoms made me suspicious that I may have thrashed a portion of the flash, with approx 150 users and 2 years of use. @Lantis Do you know how much/if any wear leveling happens with OpenWRT/Gargoyle? I may be totally off base and just need to re-flash the firmware, but worth getting an expert opinion.

Lantis
Moderator
Posts: 6910
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Saving bandwidth monitoring data to USB, higher frequency saving

Post by Lantis »

There's no wear levelling in OpenWrt/Gargoyle itself. The flash controllers may do some on board, and may do detection of bad blocks.
This is also dependent on flash chip, and file system type.
The backups are triggered every 4 hours, which for 2 years is ~4.5k writes. It should not have caused significant issues.
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

cal800
Posts: 6
Joined: Wed Jun 19, 2024 5:45 am

Re: Saving bandwidth monitoring data to USB, higher frequency saving

Post by cal800 »

Any way to turn off saving to flash or or just have it save to ram. Or even just disable it?

Prefer to protect the flash if possible as my ISP already has bandwidth logs

Lantis
Moderator
Posts: 6910
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Saving bandwidth monitoring data to USB, higher frequency saving

Post by Lantis »

cal800 wrote:
Sat Jun 22, 2024 1:15 am
Any way to turn off saving to flash or or just have it save to ram. Or even just disable it?

Prefer to protect the flash if possible as my ISP already has bandwidth logs
See here:
https://github.com/ericpaulbishop/gargo ... feaf9c084e

You would also need the previous two commits.
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Post Reply