Re: How to wait for kernel messages?

From: Jim Keniston
Date: Tue Oct 14 2003 - 16:12:11 EST


On Mon, 13 Oct 2003, Sebastian Piecha wrote:

> I have some problems with one NIC. Due to lack of time as an
> workaround I'd like to wait for the kernel message "NETDEV WATCHDOG:
> eth0: transmit timed out" and ifconfig down/up the NIC.
>
> How can I trigger any action by such a kernel message? Do I have to
> grep the kernel log?
>
> Mit freundlichen Gruessen/Best regards,
> Sebastian Piecha

If you had LTC's Event Logging installed, and you had your kernel
configured to forward printk messages to the event log, you could
do something like this:

evlnotify -f 'data~"NETDEV WATCHDOG: eth0: transmit timed out"' \
-a 'ifconfig eth0 down; ifconfig eth0 up'

That would cause the ifconfig down/up to run each time the indicated
printk happened.

Jim Keniston
IBM Linux Technology Center
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/