Running a UDP Remote Console with Linux 2.6 39
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."
Re: First Post? (Score:5, Funny)
Re: First Post? (Score:1)
Tempting... (Score:2)
Re:Tempting... (Score:4, Funny)
Bruce
Re:Tempting... (Score:5, Informative)
Re:Tempting... (Score:2)
Bruce
Re:Tempting... (Score:4, Informative)
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.
Re:Tempting... (Score:2)
I must confess to being surprised that syslog can't just be told to accept packets only from a list of IPs.
Bruce
Re:Tempting... (Score:5, Interesting)
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.
Re:Tempting... (Score:3, Interesting)
If I had another machine in the same data center, I'd not be sending UDP over the internet.
Thanks
Bruce
Re:Tempting... (Score:2)
I've had good luck with syslog-ng's TCP support. That's what brought me to syslog-ng in the first place.
Or is that what you were getting at?
Re:Huh? (Score:4, Funny)
Bruce
That's A Phrase You Never Hear (Score:2, Funny)
"The system is being slashdotted now, maybe that will help."
some conditions.. (Score:5, Informative)
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
Re:some conditions.. (Score:3, Interesting)
Bruce
Re:some conditions.. (Score:5, Informative)
Another option might be to build your own - take an older spare machine and stick a PCI USB controller in it and add a bunch of USB-to-serial dongle devices (possibly with a USB hub). These show up as
You can then ssh in and use minicom or whatever. You get added security since many terminal servers don't support ssh, plus you have a fully configurable system to manage stuff. You could write a program to page/email you on certain kernel events for example. It could be pretty flexible if that is what you need.
Just my two cents.
BTW, Bruce, thanks for your contributions to the community and to Debian. We all appreciate it.
-molo
Re:some conditions.. (Score:2)
Re:some conditions.. (Score:2)
Re:some conditions.. (Score:5, Informative)
2. Correct, the purpose of netconsole being to capture kernel messages that otherwise would not be sent due to a hung kernel - all other messages, syslog can take of.
3. Unlikely. If the kernel can panic, it can use netconsole. Used with nmi_watchdog, you can even get a stack trace from a stuck interrupt handler
4. No, netconsole uses polling-mode and drives the nic driver directly.
Note that netconsole can also dump the entire contents of RAM.
Re:some conditions.. (Score:2)
4. Thanks for the info, I'll have to read up on that.
-molo
Re:some conditions.. (Score:2)
What do you mean by "hard lockups" exactly? NMI cant be disabled AIUI, so unless hardware were hung, there's a good chance you can get a panic.
--paulj
Re:some conditions.. (Score:3, Insightful)
Well, a friend of mine using 2.6 is experiencing random lockups (we suspect either hardware problems, or ghosts), with nothing ever logged. However, he can still ping the machine even after it's locked up, but the console also doesn't respond. I've pointed him at this article, and he's going to try enabling netconsole to see if anythi
Re:some conditions.. (Score:2)
Is he using X, a framebuffer console or a standard VGA console? I've had plenty of times where X locked up on me and I wasn't able to recover the video device. This is not uncommon on some hardware. Best bet at that point is to ssh in and reboot.
If X locks up, there is nothing to be logged. The kernel sees it as just another userspace process.
-molo
Re:some conditions.. (Score:2)
Re:some conditions.. (Score:1)
Same thing as sending syslog to remote loghost? (Score:3, Insightful)
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 [sourceforge.net] project does this, but they're not exactly stable yet (hell, their website won't even load right now).
Re:Same thing as sending syslog to remote loghost? (Score:5, Insightful)
IRIX isn't the only operating system that does crashdumps. I've found them to be an invaluable tool for debugging FreeBSD. It has supported them for quite a long time. The ability to gdb your kernel and the vm after you reboot and see exactly where things went wrong is great. I still don't understand why Linux lacks this.
Re:Same thing as sending syslog to remote loghost? (Score:1, Offtopic)
For FreeBSDers, try ethercons (Score:5, Interesting)
Oh I'll see them... (Score:2)
My console is a 300 baud teletype you insensitive clod!
Re:Oh I'll see them... (Score:5, Funny)
THERE'S STILL LOTS OF LIFE LEFT IN MY 5-LEVEL BAUDOT MACHINE.
BRUCE
SNMP trap? (Score:1, Insightful)