Click to See Complete Forum and Search --> : Dump all your log messages to a terminal
Craig McPherson
01-14-2001, 05:38 PM
This one is really simple, but cool.
Just add this to your syslog.conf:
*.* /dev/tty13
(make sure you don't have a blank space after the 13 -- that'll screw the entire thing up because the syslog configuration file is really sensitive... also put a few tab stops in between the "*.*" and the "/dev/tty13" so it lines up with the rest of the file instead of putting spaces between them)
File logging will continue normally, but now all log messages will appear on tty13 also.
How do you switch to tty13? Not difficult: from a CONSOLE (not from X), hold down the RIGHT ALT key (the alt key on the right side of the keyboard) and press F1.
You should see log messages appear there instantly as they come in.
This can be really convenient -- much more so than opening logs in a text editor & skipping to the end, or tailing them continuously. You can basically watch what's happening on your system here.
If you want to eliminate unimportant debug information, replace "*.*" with "*.info". For only errors and really important stuff, you can use "*.err". For all the other various loglevels, see the syslog.conf man page.
If you have an old serial dumb terminal lying around (and come ON, who doesn't???), you can run a long serial cable and watch your log messages from anywhere in the house!
If you have an old line printer, you can have all or some of your log messages (probably you'd want to only do this with "err" level or higher -- unless you want to spend a lot of money on paper and ribbon") dumped directly to the printer -- so that if somebody r00ts your system, they can't delete the log files.
See the syslog.conf man page if you want to learn more about the fun and exciting things you can do.
Damn, that is cool. Could you explain "tab stops"?
Craig McPherson
01-27-2001, 05:26 PM
That means press the tab key a few times... just to line things up like they are in the file.
How would I go back to a command prompt after hitting R-Alt and F1 and seeing the log messages?
Craig McPherson
01-30-2001, 05:19 AM
To switch to the first terminal, you press LEFTALT-F1
To switch to the second terminal, you pres LEFTALT-F2
To switch to the third terminal, you press LEFTALT-F3
I think you see where we're going.
To switch to the thirteenth terminal, you press RIGHTALT-F1
The thirteenth terminal is where I have log messages go. If you haven't fiddled with your /etc/inittab, and you're running X, you probably have X running on the 7th terminal (LEFTALT-F7).
So you can get to 24 different terminals using the alt and function keys, but unless you edit your /etc/inittab, only the first six have login screens on them.
I personally run login screens on consoles 1-11, X on 12 if I'm using X on the machine, log messages on 13, and severe log messages on 14.
Hi Craig, and everyone else who is following this thread. I got my hands on a dumb serial terminal (LinkMC5), and have connected it to a serial port using a crossover cable. It's on, it's blinking at me; I am guessing I have to configure linux to know it's there and communicate with it. What do I need to do to set it up and get it to work?
I added *.* /dev/ttyS0 to syslog.conf, and I get the log file. Hehe, small things for small minds....
Still trying to get a login prompt, but I am RTFM's as we speak...
To add some completion to this thread, if I'm talking to myself, so be it, but someone may want to know, some day... :)
In order to get the terminal running with a login prompt, I installed the getty_ps rpm from redhat, added the following to /etc/inittab
S0:2345:respawn:/sbin/getty ttyS0 DT9600 vt100
Brief explanation: 2345 - runlevels; respawn - start if killed; ttyS0 - serial port = windows COM1; 9600 - baud rate; vt100 - terminal type)
Reboot and presto, a login on the terminal.
For more details: http://www.linuxdoc.org/HOWTO/Text-Terminal-HOWTO.html
[ 03 February 2001: Message edited by: VRay ]
LoRdMaUL
02-07-2001, 01:18 PM
I tried adding this line to the syslog.conf and then tried pressing the RIGHT alt key and F1 and I don't get this 13th terminal with all the messages on it. :mad:
Hmm, that is all I did and it worked. Are you trying directly from the console? I don't think it will work if you have started up the GUI....
Craig McPherson
02-10-2001, 03:18 AM
Hey... would anybody have a clue as to where one might be able to pick up ancient serial terminal for a reasonable price today? A lot of universities and businesses are finally dumping them, so there should be some floating around out there if they're not in the garbage yet, and they're cool things for UNIX geeks to have.
I forgot to point out that you can only get to consoles 13+ from a text console, not from X. X is hard-coded to trap console switching signals. You have to press (say) control-alt-F1 from X to switch to text console one, and then rightalt-F1 to get to console 13. If you can't get this to work, dump your logs to console 12 or something: you can switch to it from X with one keystroke (control-alt-F12). X acts the same whether you use the left alt or right alt key, so you can only get to the first 12 consoles directly from it.
(If you want to read some more stuff I wrote about inittab, gettys, and stuff, I wrote a post in this folder called "Booting to something other than a login prompt" a few weeks back.)
X_console
02-10-2001, 03:24 AM
Say Craig, why not compile the stuff you wrote about inittab/getty/etc... into an NHF? I'm sure a lot of the people here and those who don't check the forums would find it helpful and interesting.
Just a thought.
Craig McPherson
02-10-2001, 06:39 AM
I've been meaning to get around to it... thanks for reminding me... I've written probably 3 or 4 things here that could be NHF'd, plus maybe a few elsewhere. I'll try to round them up...
Craig, after reading this forum I set out to find a terminal. I posted a request on my own site's message boards which only has about 10 active users :p and a couple of guys had a few of them to offer me for free. I doubt you will have to pay anything at all. Most folks are just happy to get some more of that so called crap out of the basement.
otheos
02-14-2001, 07:11 PM
How can you make a term within X (an xterm or a gnometerminal) display all this stuff?
X_console
02-15-2001, 02:39 AM
Originally posted by otheos:
How can you make a term within X (an xterm or a gnometerminal) display all this stuff?
One way to do this is to start your xterm with the -C option. This will enable it to recieve console messages. You'll need to make sure the following line is in your /etc/syslog.conf first though:
*.=info;*.=notice /dev/console
This will allow you to recieve all messages with the info or notice priority. Make sure you do a killall -HUP syslogd if you make any changes to /etc/syslog.conf
justlinux.com
Copyright 2007 Jupitermedia Corporation All Rights Reserved.