Were's the bandwidth usage data saved?

General discussion about Gargoyle, OpenWrt or anything else even remotely related to the project

Moderator: Moderators

Post Reply
thecrazy
Posts: 20
Joined: Mon Aug 09, 2010 11:33 pm

Were's the bandwidth usage data saved?

Post by thecrazy »

So i was wondering were the data for the bandwidth usage is saved...

I used to use Tomato which offered to save the bandwidth usage data in several places... ram only, nvram, cifs, etc...

I'm asking cause i don't want to loose the data on power failures and we get a lot of those here. I also hope its not saved in the nvram, as frequent writes in there will eventually brick the router for good.

User avatar
DoesItMatter
Moderator
Posts: 1373
Joined: Thu May 21, 2009 3:56 pm

Re: Were's the bandwidth usage data saved?

Post by DoesItMatter »

I think its under

usr/data/bwmon

and yes, It does write to flash - where else is it going to write?

has to write to flash to preserve the data in case of a reboot
and/or power failure.
:twisted: Soylent Green Is People! :twisted:
2x Asus RT-N16 = Asus 3.0.0.4.374.43 Merlin
2x Buffalo WZR-HP-G300NH V1 A0D0 = Gargoyle 1.9.x / LEDE 17.01.x
2x Engenius - ESR900 Stock 1.4.0 / OpenWRT Trunk 49400

thecrazy
Posts: 20
Joined: Mon Aug 09, 2010 11:33 pm

Re: Were's the bandwidth usage data saved?

Post by thecrazy »

Whats the write frequency?

User avatar
DoesItMatter
Moderator
Posts: 1373
Joined: Thu May 21, 2009 3:56 pm

Re: Were's the bandwidth usage data saved?

Post by DoesItMatter »

Not sure... you would have to check that yourself.

If you login via telnet, you can check it every so often.

Maybe hourly? I think its more often than daily because it
should have pretty current data if the router happened to reboot.

I am not sure myself as I never monitor bandwidth usage.
I've only used it a couple of times just to test the feature.

----------------------------

Edit: OK - found out where this setting is:

Status Tab -> Bandwidth Usage sub-tab -> Time Frame setting

You can choose every 15 mins, every 6 hours, every day, etc...

So you can choose what you think is best for your area,
depending I guess on how often you might have a power outage.
:twisted: Soylent Green Is People! :twisted:
2x Asus RT-N16 = Asus 3.0.0.4.374.43 Merlin
2x Buffalo WZR-HP-G300NH V1 A0D0 = Gargoyle 1.9.x / LEDE 17.01.x
2x Engenius - ESR900 Stock 1.4.0 / OpenWRT Trunk 49400

hipitihop
Posts: 22
Joined: Thu Aug 12, 2010 1:16 am

Re: Were's the bandwidth usage data saved?

Post by hipitihop »

In the Tomato firmware I used previously http://www.polarcloud.com/tomatofaq#what_is_cifs, usage data could be optionally saved to a cifs share. This worked well for me as I have a ReadyNAS which can provide cifs shares as well as NFS shares etc. So I would provide a special share just for my router to use.

Lets not reinvent the wheel, maybe the code can be borrowed.

Eric
Site Admin
Posts: 1443
Joined: Sat Jun 14, 2008 1:14 pm

Re: Were's the bandwidth usage data saved?

Post by Eric »

DoesItMatter: that's not the write frequency, that's the display frequency for the graph/tables.

The write frequency is hard-coded to once every 4 hours.

The data is saved (in binary form) to files in /usr/data/bwmon and /tmp/data/bwmon. Note that /usr/data/bwmon files are persistent, while /tmp/data/bwmon is on the ramdisk, so these files get erased when the router reboots. Only short time-frame files are saved to the ramdisk.

billymm
Posts: 4
Joined: Wed Jun 08, 2011 1:59 am

Re: Were's the bandwidth usage data saved?

Post by billymm »

Ive just started using gargoyle & definitely like the simplified interface. I was using both tomato & dd-wrt on different routers

Thankyou for specifying the user data locations ;)
Eric wrote:The write frequency is hard-coded to once every 4 hours
Is it possible to change this write freq value from 4 hours via code / script?

If not could it be a request for a future release.... Im on a cable internet connection & a lot of data can be downloaded in 4 hours

Post Reply