How to log syslog on AP or WDS configured Router

Discussion in 'Tomato Firmware' started by Sean Rhodes, May 18, 2014.

  1. Sean Rhodes

    Sean Rhodes Networkin' Nut Member

    I have two routers both running shibby's latest firmware v117:
    Linksys E4200 v1 is my main router connected to the WAN with a Linksys WRT54GS v4 setup as WDS (could not for the life of me get AP, Client or wireless bridging to work, but thats another story).

    I'm logging my E4200 and backing up the nvram etc (to a /tmp/mnt/logs usb) without a hitch, but I can't do the same on my WRT54GS unfortunately (since there's no way to point to a mount point), I got the bandwith and IP monitoring setup, not how I really wanted, but I setup a cifs share and pointed it to the usb mounted on my E4200 router, so all is working great (main router and cifs \\\logs on WDS

    Unfortunately I can't do the same with the syslog, the Custom log File Path wants to see a hard mount and logging to a remote IP (i.e. my E4200) doesn't like the back and forward slashes in the path.

    Is there anyway around this that anyone can suggest?

    Thanks in advance
  2. koitsu

    koitsu Network Guru Member

    Busybox syslogd supports the -R flag, which is what you're looking for (re: how to forward syslog messages to another syslog server):

    Usage: syslogd [OPTIONS]
    System logging utility
    (this version of syslogd ignores /etc/syslog.conf)
            -n              Run in foreground
            -O FILE         Log to FILE (default:/var/log/messages)
            -l N            Log only messages more urgent than prio N (1-8)
            -S              Smaller output
            -s SIZE         Max size (KB) before rotation (default:200KB, 0=off)
            -b N            N rotated logs to keep (default:1, max=99, 0=purge)
            -R HOST[:PORT]  Log to IP or hostname on PORT (default PORT=514/UDP)
            -L              Log locally and via network (default is network only if -R)
    There isn't any support for this in the GUI, however, so the easiest solution is to do something like this in Administration / Scripts / Init (because you only want this done once):

    kill `cat /var/run/`
    syslogd -R lanipofsyslogserver
    And that's it. Log rotation flags, blah blah don't apply because all syslogd is going to do is forward messages to another syslog server.
  3. jerrm

    jerrm Network Guru Member

    Not sure about the 4MB builds, but my Shibby 117 has remote logging options in the GUI. If cifs is available, then logging to a mounted cifs share should work as well.

    For remote logging to work, the target IP needs to be running a syslog server that listens for remote packets. I don't think buybox syslogd does so.

    The below settings log both to the cifs mount and to a remote syslog server.

    The generated syslogd command is:
    syslogd -R -L -s 4000 -O /cifs1/logs/log -b 3
  4. koitsu

    koitsu Network Guru Member

    So it is in the GUI! I didn't even notice that checkbox (Log To Remote System) due to where it's positioned. I was totally wrong; thanks as usual @jerrm!
  5. Sean Rhodes

    Sean Rhodes Networkin' Nut Member

    Thanks for the help guys!

    Much appreciated
  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