Saving Bandwidth Monitor history to a WinXP Shared Folder

Discussion in 'Tomato Firmware' started by najevi, Nov 30, 2007.

  1. najevi

    najevi LI Guru Member

    24 hours after flashing my WRT54GL v1.0 with Tomato v1.11 I am very impressed. :)
    Installation and configuration was, in a word, intuitive. The Wiki based manual offered useful insight for most (though not all) configurable parameters and this forum looks like it may complement that knowledge base very well.


    Automated hourly saving of Bandwidth Monitor history to a fileshare on a connected Windows XP host would not work at first. It now does but I thought I should share my initial stumbling block here in case other converts stumble onto the same problem and search this forum for a solution.

    Be aware of:
    1. the Share Permissions of whatever folder you decide to share on your windows host
    2. the User account chosen at the Administration : CIFS Client page of Tomato web UI

    I chose to share a folder on a FAT32 partition thinking that I would avoid NTFS security complications. I later realized that the Share Permissions were set to Everyone: {Read}
    Since I choose to use a Limited User account/password pair at the Administration : CIFS Client web page, that account was not able to write to the file-share with the Share Permissions as above.

    I could have fixed this by either specifying a User account with Admin privileges or by changing the Share Permissions to Everyone: {Full Control, Change, Read}

    - - - - - -

    I had used the telnet command killall -sighup rstats to verify the above and whilst that command does indeed cause the rstats file to be saved to the shared folder the automated save based on Administration : bandwidth Monitoring : Save Frequency is not happening as expected.

    Any advice?
  2. najevi

    najevi LI Guru Member

    What am I missing with this "Save Frequency" setup?

    In a nutshell: I can't get regular saving of Bandwidth Monitoring history to work OR if it is working, then I am not understanding what benefit I am getting.

    My GOAL
    Maintain an hourly history of Upload and Download usage on the WAN port.
    (At least this is the initial goal. Eventually I want that same hourly granularity for each device on the network. But that's about 5 steps away from where I am right now!)

    The following are what I believe to be the four vital elements of the setup. Let me know if I have missed something, please!

    I have a fileshare named "Bigpond_Gateway" on a FAT32 partition on a Windows XP Pro machine powered up 24x7 and connected by CAT5 cable to the WRT54GL. The IP address of that machine is always thanks to the DHCP static lease table.
    Share Permissions are Everyone={Read} + Administrators={Full Control, Change, Read}

    Windows Firewall
    Windows firewall is enabled and in the Exceptions list I have checked File and Printer Sharing. There are no

    CIFS Client
    At Administration : CIFS Client ( :
    Enabled: checked
    UNC: \\\Bigpond_Gateway
    Username: AdminAcct
    Password: AdminPasswd
    Domain: blank
    Execute when Mounted: blank
    Enabled: unchecked

    Bandwidth Monitoring
    At Administration : Bandwidth Monitoring ( :
    Enable: checked
    Save History Location: CIFS1
    Save Frequency: Every Hour
    Save on Shutdown: checked
    Create New File / Reset Data: checked initially but thereafter left unchecked
    First Day of Month: 2
    Excluded Interfaces: blank

    Q1. Is there anything else I should have set up?

    Using the telnet command killall -sighup rstats I have verified that a file named tomato_rstats_<MAC-address>.gz is saved to the shared folder.

    Although I wait several hours there is no evidence of the above file being updated. This is true even if I reboot or power cycle the router and wait another few hours.
    To be fair, whenever I reboot the router the above file is updated - so at least there is evidence that the Save on Shutdown feature is working.

    Q2. Should this tomato_rstats gzip file be updated every Save Frequency period? Is this file supposed to be saving up & down BW usage data for the hour/minute level of granularity or only the cumulative up & down BW used for the day/days/month(s) so far?

    I see two threads at this forum that touch on this subject under the subject headings:
    [SCRIPT] Automated FTP Backup/Restore of stats
    Keep bandwidth data when rebooting

    Reading the two makes me wonder if I have properly understood what functionality is supposed to be delivered by the Bandwidth Monitoring feature.

    Q3. Could somebody who is using Bandwidth Monitoring successfully please describe what benefit they are enjoying? (and maybe take a crack at expanding on the descriptions given in the Tomato wiki entry at )

    Currently, whenever I reboot or shutdown the router and then return to the Bandwidth : Last 24 Hours chart I see that prior data is lost. I do however, see that the tomato_rstats gzip file has been modified at the time of reboot or shutdown.

    Q4. Why is this so?

    Other specific questions that I'd like to know answers for but are not critical at this time include:
    1. Explain the function of the checkbox labeled Create New File / Reset Data: Enable if this is a new file

    2. Explain the effect that the list labeled Excluded Interfaces has on the file that is supposed to be periodically saved.
    Thank you!
  3. najevi

    najevi LI Guru Member

    'Save On Shutdown' disables 'Save Frequency'

    I discovered the reason for my dilemma but not a solution.

    On a whim I unchecked the configuration box for
    Administration : Bandwidth Monitoring : Save on Shutdown
    then saved and went to bed.

    The next morning I checked my shared folder and discovered the modified date/time on the rstats gzip file is less than one hour ago - just as I would expect if the hourly save frequency parameter is being acted upon. I just now waited for the next hour to pass and lo' and behold the file was saved again exactly one hour later!

    So my theory is that when the Save on Shutdown routine was implemented it became an either-or-but-not-both type of co-existence with the Save Frequency routine.

    If Jon Zarate or a fellow developer reading this post would confirm then that would put my mind at ease. (Then again I might be brave and take a peak tat he source code to see if I can confirm this myself.)

    I would appreciate any third party confirming this working theory.
    Tomato Firmware v1.11.1217
  4. ceevee

    ceevee Network Guru Member

    Are the bandwidth logs supposed to restore automatically after a reboot?

    I'm saving the logs to CIFS 1.
  5. najevi

    najevi LI Guru Member

    I am not sure! Daily, Weekly and Monthly history is certainly restored but it appears to me that intra-day history for the Past 24 Hours is not restored. I am not sure why! :redface: Based on my experience below it is probably operator error!!

    - - - - -

    I can no longer reproduce the original, errant behaviour that I reported! I have operated the WRT54GL successfully using Save on Shutdown disabled and enabled and the tomato_rstats backup file is being saved regularly every hour based on Save Frequency. :confused: Jon confirmed that the two features are designed to coexist without interference. Perhaps what I saw was some fluke based on my inexperience configuring the firmware.

    Either way, it is good news for me.

    - - - - -

    Helpful reading to clarify the role of the 5 network interfaces (vlan0, vlan1, br0, eth0, eth1) :

    - - - - -

    Take a look at the Tomato firmware wiki updated entry for this feature and correct any misconceptions I may have propagated.

  6. ceevee

    ceevee Network Guru Member

    Thanks, I used your info to set mine up.
  7. najevi

    najevi LI Guru Member

    That's scary ... a bit like the blind leading the blind !!! :cool:
  8. boteeka

    boteeka LI Guru Member

    What if my user account doesn't have a password? It won't let me leave the password field empty.
  9. najevi

    najevi LI Guru Member

    That is correct. File-shares require that you use an account with a password to authenticate before you are given permission to access the shared folder. The account you authenticate with does not need to be your regular user account. Just create an account with a password and use that account to set up the CIFS 1 or CIFS 2. Continue to log in using an account with no password if that is your preference.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice