Solved

How to redirect console messages on a linux terminal console on the remotely ssh terminal screen?

Posted on 2009-05-14
5
1,036 Views
Last Modified: 2012-08-13
When I login into my console terminal on a linux OS, I see lots of messages being displayed. When I ssh into this same server, I don't see any console messages as I would see during directly connected to the terminal console.
0
Comment
Question by:areyouready344
5 Comments
 
LVL 11

Accepted Solution

by:
climbgunks earned 200 total points
ID: 24392078

Most of these messages are written to various log files (typically in /var/log).  The most commonly used of these is /var/log/messages.   To see the recent messages, plus any new messages that show up, run the following in the background after you ssh in.

tail -f /var/log/messages &

or to be more precise, if you want to see more than just the last 10 lines...something like

tail -f -100 /var/log/messages &

and, in case the log file changes,

tail --follow=name -100 /var/log/messages &

0
 
LVL 16

Expert Comment

by:ai_ja_nai
ID: 24392952
> I see lots of messages being displayed.
what kind of messages? can you paste something?
0
 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 150 total points
ID: 24393998
Critical messages are sent to files and console. If you want you can send therm to root (if logged in) or to logged in users' terminals. Please see the example below:

*.alert                      root,joey

this is done in the /etc/syslog.conf file. please see the link below for more examples

http://linux.die.net/man/5/syslog.conf
0
 
LVL 12

Assisted Solution

by:hfraser
hfraser earned 150 total points
ID: 24394012
The messages are being written to /dev/console, the physical console, which is either the local display connected to the computer, or the serial port if it was booted this way. As climbgunks mentioned, most of them are coming from syslog (or syslog-ng), which acts like a dispatcher, receiving messages and sending them to one or more destinations, including /dev/console.

You can change the way syslog is works by adding other destinations. Since an actual remote device can vary each time you connect, it's a bit problematic to add it as a destination. But if there are messages written to the console through syslog that aren't also contained in a file, you could add a new file as a target and use climbgunks's suggestion to tail the file.

Note that this only works for messages originating from syslog. If there's something writing directly to /dev/console, you're out of luck.
0
 

Author Comment

by:areyouready344
ID: 24395772
Thank youu all for your helpful comments.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to get maximum transfer speed over LAN 4 84
Can't See Site After DNS Resolved 7 55
linux installs 6 60
how can I get powershell to show the history of commands used ? 10 56
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question