Operating System - Linux
1830216 Members
1738 Online
109999 Solutions
New Discussion

Re: Capture console screen for diagnostics.

 
John Dvorchak
Honored Contributor

Capture console screen for diagnostics.

I have about 45 PC based Linux (Red Hat 2.4.7-10) systems that do not have out of band management. We have a series of switches that allow me to share one keyboard, mouse and monitor with each group of 8 systems. The problem that I am having is that occassionally they "freeze" up and have to have their power cycled to unstick them. No CTL-ALT-DEL does nothing and sometimes I can't even hit a space bar or rattle the mouse to read what the screen has to say, it just remains blank. The application folks have asked me to write down everything on the screen before I recycle the power and sometimes that is just not possible because of the screen saver etc.

What I am looking for is a way to capture whatever goes to the console (Monitor) to a file, it has to survive a reboot, for analysis after it freezes and I have to cycle power. I am an HPUX admin and not really all that familiar with the inner workings of Linux, but I have been tasked with keeping these things running. So please be explicit.

I also can't really hook up 45 serial cables to interconnect them all, as sometimes they fail in pairs. I could, however, hook serial cables up to our global system that allows out of band management via serial cables like on the HPUX, AIX etc systems. That would require my submitting a cost justification, which I would prefer not to do if I can get the thing to log to a file.
Thank you.
If it has wheels or a skirt, you can't afford it.
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: Capture console screen for diagnostics.

Assuming you are booting into the GUI, I think its the same as windows, alt-Print Screen.

These failures btw are usually not a result of Linux. They are due to poor quality control in these keyboard/monitor sharing devices.

Here is a list of files that have the ability to manipulate console output.


./X11/xdm/GiveConsole
./X11/xdm/TakeConsole
./lpd.conf
./ppp/ip-down.ipv6to4
./ppp/ip-up.ipv6to4
./security/console.perms
./tripwire/twpol.txt
./syslog.conf


In one of these files, perhaps syslog.conf you should be able to redirect console output just like you would on your HP-UX box.

I know its not complete, but I have a vague memory of doing this once on a Red Hat 4.x system.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
U.SivaKumar_2
Honored Contributor

Re: Capture console screen for diagnostics.

Hi,


Edit /etc/syslog.conf modify the current line to this ( instead of /dev/console we use /var/log/kernel.log ) and save.

kern.* /var/log/kernel.log

#touch /var/log/kernel.log

#service syslog restart

Now all kernel messages is logged in to /var/log/kernel.log file.

regards,
U.SivaKumar






Innovations are made when conventions are broken
Claudio Cilloni
Honored Contributor

Re: Capture console screen for diagnostics.

I don't know if this is exactly what you need.
A way to have a screenshot of the console screens accessed by CTRL-ALT-Fn keys is reading the /dev/vcs1 /dev/vcs2 /dev/vcsX devices.

$ cat /dev/vcs1

give a character stream of the content of the first console screen.

hth
Claudio
John Dvorchak
Honored Contributor

Re: Capture console screen for diagnostics.

I really didn't find what I was looking for, and maybe it is because I am used to real computer and not PC's. When these things freeze there are sometimes pertinent information in the /var/log/messages but I was kinda hoping for some magical way to redirect the console (PC monitor) to a file even if the errors are generated by the BIOS. It seems that all I can do is log kernel errors, and I am already doing that, and that makes sense because the kernel it running and logging but before it boots or just after it fails the BIOS is outputting data to the console. I was looking for something that would grab all of that info too. Thanks for the help and I did modify /etc/syslog.conf to suite my needs but nothing earth shattering.
If it has wheels or a skirt, you can't afford it.