1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

setting up USB access for logs/bandwidth stuff

Discussion in 'Tomato Firmware' started by vivithemage, Dec 15, 2012.

  1. vivithemage

    vivithemage Serious Server Member

    I have everything going to my USB drive which is mounted : /tmp/mnt/sda/
    I created two directories :
    /tmp/mnt/sda/bandwidth_logs/
    /tmp/mnt/sda/syslog/
    Do I need to give the directories special permissions? I don't think my logs are being written, as the directories are empty.
     
  2. gfunkdave

    gfunkdave LI Guru Member

    I have the same setup, and it works fine.

    Do you have those paths set in the appropriate Settings pages? Specifically, for IP Tracking and Bandwidth, the path given should be to a DIRECTORY, and it SHOULD end in a slash ("/").

    For the system logs, the path given should be a FILE, and it should NOT end in slash.

    Mine are all only writable by root (permissions 755).
     
  3. vivithemage

    vivithemage Serious Server Member

    I did set the configurations up, but I did not create a file for the logging, what should it be?

    permissions look good :

    root@unknown:/tmp/mnt/sda# ls -al
    drwxrwxrwx 1 root root 4096 Dec 14 15:47 .
    drwxr-xr-x 3 root root 60 Dec 31 1969 ..
    drwxrwxrwx 1 root root 0 Dec 14 15:47 bandwidth_logs
    drwxrwxrwx 1 root root 0 Dec 14 15:46 syslog
     
  4. vivithemage

    vivithemage Serious Server Member

    Anyone have any thoughts on this?
     
  5. Mercjoe

    Mercjoe Network Guru Member

    I have a simple way....

    I mount the USB drive as a CIFS, then enable file sharing.

    The router then writes to it as if it was a drive on a machine on the network. No fancy directories or permissions. I just direct the logs to CIFS1
     
  6. vivithemage

    vivithemage Serious Server Member

    How would I do that?
     
  7. vivithemage

    vivithemage Serious Server Member

    How would I do that?
     
  8. Mercjoe

    Mercjoe Network Guru Member

    Detailed instructions coming.
     
  9. vivithemage

    vivithemage Serious Server Member

    Cool :)

    AS in posted in this thread sometime today? :D
     
  10. Mowax

    Mowax Serious Server Member

    Hi mate, I have a revo that is connected via CIFF's and I use syslog watcher pro, works quite well to keep track of all the logs etc.



    [​IMG]


    [​IMG]
     
  11. Mercjoe

    Mercjoe Network Guru Member

    Get a thumbdrive and format it on a PC as FAT filesystem. Give it a simple name. I called mine Thumbdrive. Put it in the USB port on the router then.

    Names & labels used for ease of reading:
    Thumbdrive is the disk name of the USB thumbrive I am using
    192.168.1.1 is the router IP. You will need to use the your actual router IP for this to work
    admin is the user name that you log on with


    USB and NAS --> USB support
    Core USB support --> checked
    USB 2.0 support ---> checked
    USB 1.1 Support ----> checked if you are using an old thumbdrive that is 1.0 or 1.1
    USB storage suport ---> checked
    File Systems support ---> FAT checked (you may check anything you want in here if you want additional formats supported)
    Automount --> checked


    Save and then go to File sharing
    Enable file sharing --> yes, no authentication
    Auto share all USB partitions --> read/write

    In Administration --> CIFS client
    Cifs1;
    Enable ---> checked
    UNC ---> \\192.168.1.1\Thumbdrive
    Username --->admin
    Password ----> <your router password>
    Click save and you should have the Total/Free Size go from <not mounted> to the amount free on your drive. If it does not mount then something is wrong somewhere.


    Now that you have the USB drive mounted and sharable all you have to do is go into the bandwidth monitoring and set your save location to CIFS1, the same with IP traffic monitoring.


    With your system logs you can set Thumbdrive as your destination and define the filename.

    If the router reboots, it automounts the USB drive and pulls the data to restore the information on the reboot. Thus you do not lose any logged data (well, except for the data lost between save times)
     
  12. vivithemage

    vivithemage Serious Server Member

    I did that for b/w and ip logging, i'll give it some time before I check it again.

    I go into the dir and it shows empty?

    is it also possible to syslog to the jump drive as well?


    root@unknown:/tmp/mnt/1GB# ls -al
    drwxr-xr-x 2 root root 16384 Dec 31 1969 .
    drwxr-xr-x 3 root root 60 Dec 16 12:08 ..
    root@unknown:/tmp/mnt/1GB#
    show mounted too :
    root@unknown:/tmp/mnt/1GB# df -h
    Filesystem Size Used Available Use% Mounted on
    /dev/root 6.5M 6.5M 0 100% /
    tmpfs 30.0M 284.0K 29.7M 1% /tmp
    devfs 30.0M 0 30.0M 0% /dev
    /dev/sda 977.7M 0 977.7M 0% /tmp/mnt/1GB
    - 977.7M 0 977.7M 0% /cifs1


    kind of odd, none of my graph/lines are showing up now, is it because of the logging?
     
  13. vivithemage

    vivithemage Serious Server Member

    update : I checked the option to save new logs and that looks like it worked.

    I am still curious about the 'syslog' saving, can I save it to the jump drive, and view it through tomoato as well? or is that for external logging only?
     
  14. Mercjoe

    Mercjoe Network Guru Member

    The log is viewed because it is stored on the router and you are just looking at a save file. I used to do that but there was not a lot of information that was relevant in the event of a crash. I just back up the BW and IP data now.

    You can access the USB drive if you look on the network from your PC. You will find it as an available drive on the router.
     
  15. gfunkdave

    gfunkdave LI Guru Member

    Why on earth would you mount a local USB drive as CIFS and access it that way? Just access it directly.

    OP: you need to check the boxes under Bandwith Logging and IP Traffic Logging to create a new data file. Perhaps that's your problem.

    You can log syslog directly to USB as well.
     
    Monk E. Boy and koitsu like this.
  16. vivithemage

    vivithemage Serious Server Member

    Ha, go figure, that is what I missed...it does work wrigint to /tmp/mnt/1GB/ direclty now.

    How does the syslogging work exactly? Can I view it, or is it just a file I need to view, if I want to look at it? Does any of this add overhead?
     
  17. beatnik

    beatnik Networkin' Nut Member

    You can view the log file:
    cat /var/log/messages

    You can look at the last 50 lines:
    tail -50 /var/log/messages

    You can watch new messages on the console:
    tail -f /var/log/messages

    Using the 'logger' function, you can write what you want to the syslog file from your scripts.
     
  18. gfunkdave

    gfunkdave LI Guru Member

    YOu can also just click the View Log option under Status or Tools or wherever it is.
     
  19. vivithemage

    vivithemage Serious Server Member

    cool, thanks!

    I will have to take a look when I get home.
     
  20. Mercjoe

    Mercjoe Network Guru Member

    MMmmm... maybe I missed the setting that said "save to attached USB drive"

    By mounting the drive as a CIFS you can use the pull down menu for a easy 'write your stuff here' redirect.

    I try to keep it simple.
     
  21. gfunkdave

    gfunkdave LI Guru Member

    Oh, I see. Routing everything through network sockets instead of direct access just seems more complex than it needs to be. I think it was Einstein who said to make everything as simple as possible - but no simpler. :)
     
    Monk E. Boy and koitsu like this.
  22. Mercjoe

    Mercjoe Network Guru Member

    Lots of things could be easier.. But I have to provide tech support to several family and friends. Getting all geeky on them just leads to frustration.
     

Share This Page