View Full Version : Simple script to remove tcp_keepalive and tcp_keepopen_proc messages in kernel log

08-14-2007, 05:46 AM
Like the title says this will clean up your kernel log making it alot easier to read. This can be run manually, scheduled with cron or you can do as I did and add it as part of the autodnsupdate script. There is a thread about patching the kernel to remove these messages http://www.dealdatabase.com/forum/showthread.php?t=33261 but I wasn't sure it would work with my software.

cp /var/log/kernel /var/log/kernel.tmp
grep -v tcp_keepalive /var/log/kernel.tmp | grep -v tcp_keepopen_proc - > /var/log/kernel
rm /var/log/kernel.tmp