getting hostname from NT machine via Citrix  
Author Message
PerfectDayToChaseTornados





PostPosted: 2005-2-24 3:27:00 Top

java-programmer, getting hostname from NT machine via Citrix Hi All,

I don't know if any one can help or has any ideas about this.

We are writing a web based application which will run on a Unix box. It will
be accessible only via a login to Citrix from client machines. We have
achieved a transparent login to the application (running in Tomcat) using an
LDAP lookup. What we are stuck on is the following. We would like to be able
to get the hostname of the NT machine which is logging on. Someone has
suggested that we may be able to do this using a signed applet. I have no
experience with Applets at all & wondered if any one knows if this is
achievable or has accomplished anything similar? Any other ideas on how we
might do this?

Many thanks

--
-P
"Programs that are hard to read are hard to modify.
Programs that have duplicated logic are hard to modify.
Programs with complex conditional logic are hard to modify"

( Kent Beck)


 
Tilman Bohn





PostPosted: 2005-2-24 3:35:00 Top

java-programmer >> getting hostname from NT machine via Citrix In message <TN4Td.206430$email***@***.com>,
PerfectDayToChaseTornados wrote on Wed, 23 Feb 2005 19:26:43 GMT:

> Hi All,
>
> I don't know if any one can help or has any ideas about this.
>
> We are writing a web based application which will run on a Unix box. It will
> be accessible only via a login to Citrix from client machines. We have
> achieved a transparent login to the application (running in Tomcat) using an
> LDAP lookup. What we are stuck on is the following. We would like to be able
> to get the hostname of the NT machine which is logging on. Someone has

Please define `hostname'.

--
Cheers, Tilman

`Boy, life takes a long time to live...' -- Steven Wright
 
PerfectDayToChaseTornados





PostPosted: 2005-2-24 3:38:00 Top

java-programmer >> getting hostname from NT machine via Citrix "Tilman Bohn" <email***@***.com> wrote in message
news:email***@***.com...
| In message <TN4Td.206430$email***@***.com>,
| PerfectDayToChaseTornados wrote on Wed, 23 Feb 2005 19:26:43 GMT:
|
| > Hi All,
| >
| > I don't know if any one can help or has any ideas about this.
| >
| > We are writing a web based application which will run on a Unix box. It
will
| > be accessible only via a login to Citrix from client machines. We have
| > achieved a transparent login to the application (running in Tomcat)
using an
| > LDAP lookup. What we are stuck on is the following. We would like to be
able
| > to get the hostname of the NT machine which is logging on. Someone has
|
| Please define `hostname'.

The machine name on the NT network. Failing that the I.P. address of the
machine will do. We just need to be able to identify which machine the login
came from.

Thanks
--
-P
"Programs that are hard to read are hard to modify.
Programs that have duplicated logic are hard to modify.
Programs with complex conditional logic are hard to modify"

( Kent Beck)


 
 
PerfectDayToChaseTornados





PostPosted: 2005-2-24 3:43:00 Top

java-programmer >> getting hostname from NT machine via Citrix
"PerfectDayToChaseTornados" <email***@***.com> wrote in message
news:iY4Td.127548$email***@***.com...
| "Tilman Bohn" <email***@***.com> wrote in message
| news:email***@***.com...
| | In message <TN4Td.206430$email***@***.com>,
| | PerfectDayToChaseTornados wrote on Wed, 23 Feb 2005 19:26:43 GMT:
| |
| | > Hi All,
| | >
| | > I don't know if any one can help or has any ideas about this.
| | >
| | > We are writing a web based application which will run on a Unix box.
It
| will
| | > be accessible only via a login to Citrix from client machines. We have
| | > achieved a transparent login to the application (running in Tomcat)
| using an
| | > LDAP lookup. What we are stuck on is the following. We would like to
be
| able
| | > to get the hostname of the NT machine which is logging on. Someone has
| |
| | Please define `hostname'.
|
| The machine name on the NT network. Failing that the I.P. address of the
| machine will do. We just need to be able to identify which machine the
login
| came from.

Tilman, I think it is called COMPUTERNAME on an NT machine. I need to be
able to lookup this environment variable on the client machine & pass it
through to the webapp (via Citrix) running on the Unix machine.

Thanks
--
-P
"Programs that are hard to read are hard to modify.
Programs that have duplicated logic are hard to modify.
Programs with complex conditional logic are hard to modify"

( Kent Beck)


 
 
Tilman Bohn





PostPosted: 2005-2-24 4:07:00 Top

java-programmer >> getting hostname from NT machine via Citrix In message <iY4Td.127548$email***@***.com>,
PerfectDayToChaseTornados wrote on Wed, 23 Feb 2005 19:37:50 GMT:

[...]
>| > LDAP lookup. What we are stuck on is the following. We would like to be
> able
>| > to get the hostname of the NT machine which is logging on. Someone has
>|
>| Please define `hostname'.
>
> The machine name on the NT network. Failing that the I.P. address of the
> machine will do. We just need to be able to identify which machine the login
> came from.

That's why I asked. Hostname is an overloaded term, especially in a
heterogeneous environment. You mentioned tomcat so you are alreay doing
servlets. The client IP address should be available through
[Http]ServletRequest[Wrapper]'s getRemoteAddress() method. Similarly,
you get the _DNS_ hostname through getRemoteHost(). This may or may not
coincide with its NetBIOS name (which I wouldn't know how to retrieve).

--
Cheers, Tilman

`Boy, life takes a long time to live...' -- Steven Wright
 
 
proGex





PostPosted: 2005-2-24 4:09:00 Top

java-programmer >> getting hostname from NT machine via Citrix Try java.net.InetAddress.getHostName()

This may help
http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part2/Chapter13/inetAddress.html

 
 
PerfectDayToChaseTornados





PostPosted: 2005-2-24 4:23:00 Top

java-programmer >> getting hostname from NT machine via Citrix "proGex" <email***@***.com> wrote in message
news:email***@***.com...
| Try java.net.InetAddress.getHostName()
|
| This may help
|
http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part2/Chapter13/inetAddress.html
|
Thanks I'll have a look.
--
-P
"Programs that are hard to read are hard to modify.
Programs that have duplicated logic are hard to modify.
Programs with complex conditional logic are hard to modify"

( Kent Beck)


 
 
PerfectDayToChaseTornados





PostPosted: 2005-2-24 4:26:00 Top

java-programmer >> getting hostname from NT machine via Citrix "Tilman Bohn" <email***@***.com> wrote in message
news:email***@***.com...
| In message <iY4Td.127548$email***@***.com>,
| PerfectDayToChaseTornados wrote on Wed, 23 Feb 2005 19:37:50 GMT:
|
| [...]
| >| > LDAP lookup. What we are stuck on is the following. We would like to
be
| > able
| >| > to get the hostname of the NT machine which is logging on. Someone
has
| >|
| >| Please define `hostname'.
| >
| > The machine name on the NT network. Failing that the I.P. address of the
| > machine will do. We just need to be able to identify which machine the
login
| > came from.
|
| That's why I asked. Hostname is an overloaded term, especially in a
| heterogeneous environment. You mentioned tomcat so you are alreay doing
| servlets. The client IP address should be available through
| [Http]ServletRequest[Wrapper]'s getRemoteAddress() method. Similarly,
| you get the _DNS_ hostname through getRemoteHost(). This may or may not
| coincide with its NetBIOS name (which I wouldn't know how to retrieve).
|
| --
| Cheers, Tilman
|
| `Boy, life takes a long time to live...' -- Steven Wright

Thanks Tilman, but getting the remote address & host through the Servlet API
won't work as all it will give me is the host of the Citrix server. I need
to get the info from a client of some sort running on the client machines &
pass it through to the host. This has to be done as part of the logon to
the webapp, so we can tie the computer name & login id together!
--
-P
"Programs that are hard to read are hard to modify.
Programs that have duplicated logic are hard to modify.
Programs with complex conditional logic are hard to modify"

( Kent Beck)


 
 
Tilman Bohn





PostPosted: 2005-2-24 5:08:00 Top

java-programmer >> getting hostname from NT machine via Citrix In message <nF5Td.167555$email***@***.com>,
PerfectDayToChaseTornados wrote on Wed, 23 Feb 2005 20:25:55 GMT:

[...]
> Thanks Tilman, but getting the remote address & host through the Servlet API
> won't work as all it will give me is the host of the Citrix server.

Ok, sorry for the noise then. I wasn't sure about your exact setup, I
thought you might be accessing applications on your terminal server
locally and just doing some client login in your web app, or maybe
trying to integrate the web app with some application on the terminal
server. (Citrix is another hopelessly overloaded term. ;-) )

[...]
> This has to be done as part of the logon to
> the webapp, so we can tie the computer name & login id together!

I guess the fact that you're asking here means you haven't found a
way to talk to MetaFrame from your web app, so I won't ask about that.

--
Cheers, Tilman

`Boy, life takes a long time to live...' -- Steven Wright
 
 
PerfectDayToChaseTornados





PostPosted: 2005-2-24 5:58:00 Top

java-programmer >> getting hostname from NT machine via Citrix "Tilman Bohn" <email***@***.com> wrote in message
news:email***@***.com...
| In message <nF5Td.167555$email***@***.com>,
| PerfectDayToChaseTornados wrote on Wed, 23 Feb 2005 20:25:55 GMT:
|
| [...]
| > Thanks Tilman, but getting the remote address & host through the Servlet
API
| > won't work as all it will give me is the host of the Citrix server.
|
| Ok, sorry for the noise then. I wasn't sure about your exact setup, I
| thought you might be accessing applications on your terminal server
| locally and just doing some client login in your web app, or maybe
| trying to integrate the web app with some application on the terminal
| server. (Citrix is another hopelessly overloaded term. ;-) )
|
| [...]
| > This has to be done as part of the logon to
| > the webapp, so we can tie the computer name & login id together!
|
| I guess the fact that you're asking here means you haven't found a
| way to talk to MetaFrame from your web app, so I won't ask about that.

Hi Tilman,

please do talk about that. This is my first encounter with Citrix, so I know
very, very little. What is MetaFrame & how do I talk to it?

Thanks
--
-P
"Programs that are hard to read are hard to modify.
Programs that have duplicated logic are hard to modify.
Programs with complex conditional logic are hard to modify"

( Kent Beck)


 
 
Tilman Bohn





PostPosted: 2005-2-24 6:49:00 Top

java-programmer >> getting hostname from NT machine via Citrix In message <C%6Td.207179$email***@***.com>,
PerfectDayToChaseTornados wrote on Wed, 23 Feb 2005 21:57:54 GMT:

[...]
> Hi Tilman,
>
> please do talk about that. This is my first encounter with Citrix, so
> I know very, very little. What is MetaFrame & how do I talk to it?

Unfortunately I won't be able to give you much (or any) concrete help
here. MetaFrame is just a product name for various Citrix offerings. At
least that's how I've always understood it. But while I have implemented
solutions in environments where some variant of these was used, I really
didn't have anything to do with them on a technical level. So any
information I might give you about it would likely turn out to be
misinformation and rather counter-productive. (I'm already afraid that
I've done you more harm than good by confusing you...)

Anyway, what I alluded to was the possibility that there could be a
way for you to query the terminal server directly about its clients. I
only said I wouldn't ask you about that because I thought you must have
surely looked into it and decided it's a no go. If you haven't, that's
what I'd check out next if I were you. That could depend on what exact
product you're really using. As I said, `Citrix' can mean a lot of
things, and the spectrum of what it can mean has changed over the years.

--
Cheers, Tilman

`Boy, life takes a long time to live...' -- Steven Wright
 
 
PerfectDayToChaseTornados





PostPosted: 2005-2-25 4:54:00 Top

java-programmer >> getting hostname from NT machine via Citrix "Tilman Bohn" <email***@***.com> wrote in message
news:email***@***.com...
| In message <C%6Td.207179$email***@***.com>,
| PerfectDayToChaseTornados wrote on Wed, 23 Feb 2005 21:57:54 GMT:
|
| [...]
| > Hi Tilman,
| >
| > please do talk about that. This is my first encounter with Citrix, so
| > I know very, very little. What is MetaFrame & how do I talk to it?
|
| Unfortunately I won't be able to give you much (or any) concrete help
| here. MetaFrame is just a product name for various Citrix offerings. At
| least that's how I've always understood it. But while I have implemented
| solutions in environments where some variant of these was used, I really
| didn't have anything to do with them on a technical level. So any
| information I might give you about it would likely turn out to be
| misinformation and rather counter-productive. (I'm already afraid that
| I've done you more harm than good by confusing you...)
|
| Anyway, what I alluded to was the possibility that there could be a
| way for you to query the terminal server directly about its clients. I
| only said I wouldn't ask you about that because I thought you must have
| surely looked into it and decided it's a no go. If you haven't, that's
| what I'd check out next if I were you. That could depend on what exact
| product you're really using. As I said, `Citrix' can mean a lot of
| things, and the spectrum of what it can mean has changed over the years.
|

Thanks Tilman,

I managed to do it today using a signed Applet getting hold of an
environment variable set by Citrix & using the Applet to pass it back to a
Servlet :-)

--
-P
"Programs that are hard to read are hard to modify.
Programs that have duplicated logic are hard to modify.
Programs with complex conditional logic are hard to modify"

( Kent Beck)


 
 
Tilman Bohn





PostPosted: 2005-2-25 5:12:00 Top

java-programmer >> getting hostname from NT machine via Citrix In message <o9rTd.215150$email***@***.com>,
PerfectDayToChaseTornados wrote on Thu, 24 Feb 2005 20:53:40 GMT:

> Thanks Tilman,

Nothing to thank me for -- looks like you solved your problem
more in spite of my advice than because of it. ;-)

> I managed to do it today using a signed Applet getting hold of an
> environment variable set by Citrix & using the Applet to pass it back to a
> Servlet :-)

Glad to hear you got it to work!

--
Cheers, Tilman

`Boy, life takes a long time to live...' -- Steven Wright