Running a UDP Remote Console with Linux 2.6
Bruce Perens writes "Many system admins have learned how to use syslog to log events of remote systems. But when the kernel crashes, its final messages never get to syslog. If you don't have a remote console manager, you won't see them, unless you
run netconsole."
did you send them via UDP? perhaps your first attempt hasn't made it yet.
Bruce
Bruce Perens.
Bruce
Bruce Perens.
This only works/is helpful in certain situations:
1. network driver is initialized
2. kernel messages are what you want to capture
3. the kernel doesn't get itself foobarred so badly that it can't send packets
4. interrupts are enabled (right? can't talk to the network card otherwise)
Also, if you change mac addresses or network cards of the first hop between the sender and receiver, this all needs to be reconfigured.
This can certainly be useful, but recognize its limitations.
-molo
Using your sig line to advertise for friends is lame.
While on the topic, though, it would be nice if Linux did something similar to IRIX, where a crash would save the kernel coredump to the swap partition. Yes, I know the Linux Kernel Crash Dump project does this, but they're not exactly stable yet (hell, their website won't even load right now).
It looks like the packet format is syslog compatible in the recent 2.6 kernels. I think the work is already done. =)
Neither does the syslogd provided with slackware. The snippet below will allow you to inclusively list log hosts.
You can repeat the first line as many times as needed, replacing $LOGHOST with an IP or a resolvable domain name. Just make sure the DROP rule goes last.
If you use FreeBSD and find this interesting, you should take a look at rwatson's ethercons patches. Basically, it is this but supports bidirectional communication. That means you can run a getty on it and login over ethernet console. Rather slick.
Beware, Nugget is watching... See?
It may not be as surprising when you note that sysklogd was written in a time where the network was considered more trustworthy, though there is another reason, which is mentioned below. You should also find the syslog-ng package available on your Debian system, which can filter by sending host, although it will spend more CPU time to do the blocking at that level. Both solutions work, though.
The reason you don't see this feature made more prominent is that UDP packets are easily spoofed, since there is no handshake required to get the payload through. With TCP, someone has to be at the "sending" host to reply to the handshake, while UDP simply accepts what it receives in the single packet (barring the sender being a local-net host, with strict ARP checking on the receiver). So anyway, filtering hosts doesn't completely cover you from log spoofing or DOSing, but it's still a good idea.
If I had another machine in the same data center, I'd not be sending UDP over the internet.
Thanks
Bruce
Bruce Perens.
THERE'S STILL LOTS OF LIFE LEFT IN MY 5-LEVEL BAUDOT MACHINE.
BRUCE
Bruce Perens.
Never heard this before, probably never hear it again:
"The system is being slashdotted now, maybe that will help."