Solved

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

Posted on 2009-05-14
5
1,049 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Do you have a plan for Continuity?

It's inevitable. People leave organizations creating a gap in your service. That's where Percona comes in.

See how Pepper.com relies on Percona to:
-Manage their database
-Guarantee data safety and protection
-Provide database expertise that is available for any situation

Question has a verified solution.

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

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

627 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