Posts Tagged ‘logrotate’

DD-WRT router firmware and syslogd

Tuesday, March 11th, 2008

To enable your linksys router with DD-WRT firmware to log to syslog (in my case running on a Centos 4 box), first enable it in the router firmware and set the host address. Then

Method 1 – Vanillla Syslogd

Put this in /etc/syslogd.conf (NOTE: this may log more than you bargained for…)

# linksys
user.* /var/log/router.log
kernel.* /var/log/router.log

And add -r (enable remote logging – only do this if you know what you’re doing) to the SYSLOGD_OPTIONS in /etc/sysconfig/syslog

Then restart syslogd.

Then add /var/log/router.log to the list of logfiles in /etc/logrotate.d/syslog

Method 2 – Syslog-NG

Syslog-NG is an improved version of syslog, unfortunately it is not GPL. Anyway if you install it, stop & disable standard syslog, then add this to the (Redhat) conf it should work.

source gateway {
udp(ip(0.0.0.0) port(514));
};

source tcpgateway {
tcp(ip(0.0.0.0) port(514) max_connections(1000));
};

destination hosts {
file("/var/log/syslogs/$HOST/$FACILITY.log"
owner(root) group(root) perm(0600) dir_perm(0700)
create_dirs(yes));
};

log {
source(gateway);
destination(hosts);
};

log {
source(tcpgateway);
destination(hosts);
};

Popularity: 66% [?]