Posts Tagged ‘logging’

Remove log statistics lines from /var/log/messages

Sunday, October 18th, 2009

If you use syslog-ng, you might find /var/log/messages has lots of lines like

Oct 18 17:42:06 stairs syslog-ng[2391]: Log statistics; processed='center(queued)=468', processed='center(received)=468', processed='destination(hosts)=0', processed='destination(d_boot)=0', processed='destination(d_auth)=42', processed='destination(d_cron)=256', processed='destination(d_mlal)=0', processed='destination(d_kern)=0', processed='destination(d_mesg)=100', processed='destination(d_cons)=0', processed='destination(d_spol)=0', processed='destination(d_mail)=70', processed='source(tcpgateway)=0', processed='source(s_sys)=468', processed='source(gateway)=0'

This is because it is default to output stats every 600 seconds. Add an entry like

stats_freq (86400);

in the options section of /etc/syslog-ng.conf and do a service syslog-ng reload (RHEL / Centos) to quieten it down a bit.

Popularity: 2% [?]

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% [?]