The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > SUN Solaris
.
google unix.com



SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to redirect the output to multiple files without putting on console prashant43 Shell Programming and Scripting 2 08-26-2009 09:53 AM
console redirect on dl365 pupp SUN Solaris 0 12-16-2008 01:05 AM
console redirect of progress bar unclecameron Shell Programming and Scripting 1 11-26-2008 03:45 AM
redirect output of dos2unix command nrbhole Shell Programming and Scripting 4 01-25-2008 09:30 AM
redirect command output to variable hugow UNIX for Dummies Questions & Answers 1 06-22-2005 06:43 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 2 Weeks Ago
makodarear makodarear is offline
Registered User
  
 

Join Date: Aug 2009
Posts: 8
Command to redirect console to my tty?

Is there a utility built into Solaris that will allow me to see console messages from a tty?

I've done a search and see that this is possible through software like ILOM, but I'm looking for a method to do this with built in utilities.

For example, on AIX, I can use swcons `tty`
  #2 (permalink)  
Old 2 Weeks Ago
jlliagre jlliagre is online now Forum Advisor  
ɹǝsn sıɹɐlosuǝdo
  
 

Join Date: Dec 2007
Location: Paris
Posts: 1,383
Not exactly the same but this is close:
Code:
tail -f /var/adm/messages
If your tty is a real one, you might also try:
Code:
consadm -a $(tty)
  #3 (permalink)  
Old 2 Weeks Ago
incredible incredible is offline Forum Advisor  
Registered User
  
 

Join Date: May 2008
Location: s'pore
Posts: 2,063
use the dmesg command
  #4 (permalink)  
Old 2 Weeks Ago
jlliagre jlliagre is online now Forum Advisor  
ɹǝsn sıɹɐlosuǝdo
  
 

Join Date: Dec 2007
Location: Paris
Posts: 1,383
Quote:
Originally Posted by incredible View Post
use the dmesg command
This shows the last lines of the message file but doesn't kind of redirect its output as the OP asked for.
  #5 (permalink)  
Old 2 Weeks Ago
makodarear makodarear is offline
Registered User
  
 

Join Date: Aug 2009
Posts: 8
Quote:
Originally Posted by jlliagre View Post
Not exactly the same but this is close:
Code:
tail -f /var/adm/messages
If your tty is a real one, you might also try:
Code:
consadm -a $(tty)
Unfortunately my tty is not a real device. I am logged in remotely using SSH.

I am managing an application that writes certain messages to console. I don't see them in /var/adm/messages. I think in the simplest form, I am trying to figure out how to access messages written to console, like:

Code:
echo "Hello World" > /dev/console
  #6 (permalink)  
Old 2 Weeks Ago
jlliagre jlliagre is online now Forum Advisor  
ɹǝsn sıɹɐlosuǝdo
  
 

Join Date: Dec 2007
Location: Paris
Posts: 1,383
Your application should use the logger facility instead of directly accessing the console. Anyway, if your application has the /dev/console steadily open, you can figure out what file descriptor it is using using pfiles:
Code:
pfiles $(pgrep application-name)
The console file descriptor (here 22) should appear this way:
Code:
  22: S_IFCHR mode:0620 dev:323,0 ino:4 uid:10001 gid:7 rdev:0,0
      O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE
      /devices/pseudo/cn@0:console
then use truss to display what is written there like this:
Code:
truss -f -w 22 -t !all -p pid
with pid being your application process id.

If that doesn't work, say because /dev/console is open and close immediately, an alternate and interesting way would be using dtrace.
  #7 (permalink)  
Old 2 Weeks Ago
wwwzviadi wwwzviadi is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 20
not sure but may be this is OK for you...
run tty to check pts number something like this
root@solaris# tty
/dev/pts/5
root@solrais#
after you now tty number you can redirect messages like this way
echo"some message here" > /dev/pts/5
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:37 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0