LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   redirect kernel messages to a telnet session? (https://www.linuxquestions.org/questions/linux-kernel-70/redirect-kernel-messages-to-a-telnet-session-781962/)

leniviy 01-13-2010 09:25 AM

redirect kernel messages to a telnet session?
 
Hi!
I heard that if you have a COM port and a cable, you can add a boot option like "console=ttySx,...".

Is it possible to have something similar, but involving the network adapter? Maybe not with userspace telnetd, but a kernel module acting like telnet server?

Does network layer stop to work when a kernel panic occurs?

cardy 01-14-2010 07:58 AM

Hi leniviy

Ok you can use the console=ttySx... option to tell the kernel that kernel messages should be displayed to this port. I use this on the rare occasion where I have a box crashing and am unable to see why.

By connecting a null modem cable between the linux host and running a terminal emulator (minicom on linux or hyperterm if win) on the second host you can see the kernel messages which can be useful in debuging issues such as a kernel crash.

It would help if you can explain what your trying to achieve as remote console access can be obtained through SSH etc.... The only reason I could see for this would be diagnosing crash issues.

leniviy 01-14-2010 08:38 AM

You're right, it's about crashes. I spent an hour trying to take a readable screenshot of a kernel panic with my camera. (At tha end I inverted console colors so screen looked brighter).

cardy 01-14-2010 02:13 PM

I have diagnosed this sort of thing before. I would recommend you get or make a null modem cable, this can be connected between 2 machines. As descibed above you then add then entry on the kernel boot line to tell the kernel to dump messages out to the serial port.

You can then run a terminal emulator on the second machine and tell it to save all output to a log file this will let you capture the crash in full detail.

It is possible to setup crash recovery where the kernel attempts to write the crash information over the network (netdump) to another server or to a particular disk (diskdump) area but the success of this depends on the reason for the crash.

You can add the following to the kernel line entry in /etc/grub.conf

Quote:

console=tty0 console=ttyS0,9600n8
It is possible to configure the grub for serial support also, the entries below can be added to grub.conf

Quote:

serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1
terminal serial

For more information on configuring grub and the console I suggest you look at the read me at The Linux Documentation Project site.

http://tldp.org/HOWTO/Remote-Serial-Console-HOWTO/


Regards

Lee


All times are GMT -5. The time now is 11:09 PM.