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 > AIX
.
google unix.com



AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Cannot ping hostname of centos server in windows xp twohis IP Networking 1 06-10-2009 11:04 AM
Checking if any folder is opened or not? Niroj Shell Programming and Scripting 11 09-10-2008 09:33 AM
CIFS Code Opened for Windows File Sharing - Redmond Developer News iBot UNIX and Linux RSS News 0 12-16-2007 02:20 PM
Solaris - unknown hostname - how can I change hostname? XNOR UNIX for Dummies Questions & Answers 1 03-29-2007 10:52 PM
How to get the opened files by a process benoit.gaillard HP-UX 2 02-28-2006 03:02 AM

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

Join Date: Nov 2005
Location: Canada
Posts: 110
Question Hostname of where any windows is opened ?

Is it possible to get the hostname of the server we are currently working on (physically) even if we have rlogged/tn to another one ?

There is this DISPLAY variable we always have to setup everytime we log to a server (anyone). It has to be set to the name of the server we are physically working on. Its a bit annoying having to do this all the time. The purpose of this variable it to use VPRINT/BPRINT command that print the content of the window we point at. It has to know on which server that window is.

ex:

I am physically on Server-A, I open up a xterm on it, in it I telenet to Server-B. If I need to print anything from that window, then I need to set DISPLAY=Server-A on Server-B.

I am physically on Server-C, I am working on an xterm logged on to that server, I do an rlogin to Server-D. If I need to print anything from that window, then I need to set DISPLAY=Server-C on Server-D.
  #2 (permalink)  
Old 4 Weeks Ago
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,272
Test if a
Code:
who am i
shows from which host you are logged in. On AIX I get this:
Code:
root@host2> who am i
root        pts/1       Oct 23 13:51     (host1)
root@host2:/root> who am i| sed 's/[^(]*(\([^)]*\))/\1/'
host1
You could use that in your command to export DISPLAY.
  #3 (permalink)  
Old 4 Weeks Ago
Browser_ice Browser_ice is offline
Registered User
  
 

Join Date: Nov 2005
Location: Canada
Posts: 110
Works only on the first rlogin.

I am on Server-A
Open up an xterm
log on to Server-B
who am I shows Server-A
on that same window I do rlogin Server-C
who am I shows Server-B


We have 22 servers in total but physically work on 2 of them. We frequently go from servers to servers through windows
  #4 (permalink)  
Old 4 Weeks Ago
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,272
"who am i" did it right, as supposed. From your 1st post it was explained there is only 1 server "hop" involved. Hopping further to the next host ie. start on A --- ssh ---> B --- ssh ---> C can't be displayed/checked.
What about typing exit when done on host B and then (back on A) ssh to host C? So "who am i" would give you the needed output in that case. Or is that not possible for the things you do on the boxes?
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:07 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