Operating System - HP-UX
1833838 Members
2373 Online
110063 Solutions
New Discussion

Re: How to recognize the virtual host name i'm logged into?

 
Bea_1
New Member

How to recognize the virtual host name i'm logged into?

Hi,
We have an Oracle Applications 11i installed in a ServiceGuard cluster as a n-tiered node, ie using 3 SG-packages. We are configured like virtual host with SG. We have some costumizers who need to log directly into different SG-packages as the same user with ssh.
Our problem is that when we log into the package, we need to run a .profile which belong to this SG-package but we cannot recognize which SG-package the user had logged into. We need a 'uname -n' like utility to determine which SG-package profile to run, but it doesn't seem to exist for SG-packages. Can anyone help?

4 REPLIES 4
G. Vrijhoeven
Honored Contributor

Re: How to recognize the virtual host name i'm logged into?

Hi Bea,

We had the same problem and we solved it by adding an toggle script to change the env. vars. In the .profile this script is started and the user is asked for the package name.

If you want to automate it i have no sollution, but to use different usernames.

Gideon
Elmar P. Kolkman
Honored Contributor

Re: How to recognize the virtual host name i'm logged into?

If you have lsof installed on your system and allow users to run it from their .profile, you can do a lsof -ip and lookup to which IP address their rlogind or telnetd is connected, resulting in the package name.

Another way, without lsof but less sure, would be using 'who -R' output to get the IP address the user comes from, then use netstat -af inet to get the line with the package name. But this only works with unique IP addresses of where a user comes from.
Every problem has at least one solution. Only some solutions are harder to find.
Rajeev  Shukla
Honored Contributor

Re: How to recognize the virtual host name i'm logged into?

lsof is the best utility to solve your problem.
I too am using packages and as soon as one loges in a package they get the banner of the package and also appropriate environment variables are set as per the package.
Use lsof and grep for "ESTABLISHED" you'll find the package name there.
Let me know if you need more help, but first install lsof..

Cheers
Rajeev
Bea_1
New Member

Re: How to recognize the virtual host name i'm logged into?

Hi all,

I thank you all for your rapid answer.
It seems that 'lsof' is the solution
to solve our problem.
We'll install the 'lsof', develop a login-script and in the meantime I put this thread on hold. I'll keep you informed...

Regards,
Bengt Albjerg (BeA), EDS DK