Logging /var/log/messages to CIFS

Is there a way to log the /var/log/messages to CIFS to my CentOS server instead of the router's RAM or SNMP? I don't want to use syslog because last time I did that, it seemed that the linux machine's logs and the router's logs were overlapping and it's not so easy to "tail -f" that.

The best way is to use the remote log function - but you have to run something on your router to file the messages that are sent. I recently confirmed in this thread the old windoze Linksys linklogger utility still functions http://www.linksysinfo.org/forums/showthread.php?t=54963

Thanks, but I don't necessarily want to use the Linksys tool. I have syslogd running on CentOS but the router logs get interspersed with the CentOS server logs. Perhaps the best way to work around this would be to figure out how to have external devices log to a different file than /var/log/messages but right now that's beyond me. I thought about SNMP but I might not have any hair left or a job after I get that working.

syslogd is simple, its not able to act as a remote logging service. you want to check out syslog-ng as an alternative. a few extra lines in the config to catch UDP packets from the router on the logging daemon port, and you're good to go. mine logs to /var/log/linksys.

FWIW, for CentOS 5 and Fedora (presumably), you have to modify /etc/syslog.conf and don't forget to create the output file (i.e., "touch /var/log/router"). Also, need to edit /etc/sysconfig/syslog to specify:
SYSLOGD_OPTIONS="-m 0 -r" and then either "/etc/init.d/syslog restart" or "service syslog restart".

EDIT: note that the page mentioned above does NOT work as expected. It does not just log stuff from your router's IP but also your Linux box. So consider the above instructions *BROKEN* for CentOS and perhaps all RedHat-type distributions. Syslog doesn't seem to allow JUST the WRT logs to go to the file /var/log/router as specified above. See "man syslog.conf".

Thanks, but that's for "el4" which means CentOS4. I'm running CentOS5 (EL5). I already have that repository in my list, and if you try to install it manually, it tells of a bunch of dependencies needed.

@mstombs: Why would the little router die,.... or did you just want me to sort the script out for you ;-)

Click to expand...

Well, perhaps I should have added a smiley- but what happens when the cifs connection or server fails? Remote syslog is udp so doesn't care if message gets through or not, where does the router send the message "can't write to system log file"?.

I tried using the logging script mentioned by 'HennieM' on Tomato 1.15, but it seems that the system log is rotating the logs which causes it to rotate the symbolically linked file as well. Any thoughts if remote logging would be a better way of doing this in Tomato 1.15.

Also, how can I find lost connections in the logs as I am tracking down issues with my router connected to a wireless modem that does not occur when attached directly to my Linux box. I get the feeling that it is not renewing the lease correctly, and so the connection is lost.