Page 1 of 1

obtaining device ip address.

Posted: Wed Apr 20, 2011 3:33 pm
by chris_rover
hi guys,
is there any way that I can obtain the ip address of the device that I am calling an RPG program using profound ui?

thanks

Re: obtaining device ip address.

Posted: Wed Apr 20, 2011 4:56 pm
by Greg
Please take a look at the following forum link:

http://profoundlogic.com/forums/phpbb3/ ... ip+address

To further clarify:

The QDCRDEVD API will not work in a Profound UI session because there is no interactive display device associated with the session. To get the IP in a Profound UI session, you must use:

getenv("REMOTE_ADDR")

Hope this helps, let us know your results.

Re: obtaining device ip address.

Posted: Thu Apr 21, 2011 8:59 am
by chris_rover
that solution works if I am using a browser from a pc. however, in our environment, we have thin clients connecting to a terminal server. this means that the ip address being collected is that of the terminal server, not the thin client, or any pc that is using the terminal server to access the browser.

any suggestions to handle this?

Re: obtaining device ip address.

Posted: Thu Apr 21, 2011 9:34 am
by David
I don't believe that there's any way you could get the IP address under this setup -- at least using built in features of the server. The IP address is reported to Profound UI by the Apache http server on the System i -- if all requests are coming from the same address, it has no way to distinguish them.

That being said, here are some ideas, assuming that you could somehow use different URLs for different end users. I'm not sure if that is the case.

1. You can name the jobs (sort of like a workstation id) when sessions are started using a query string parameter.

You could probably encode part of the IP address (at least the host number part) into the job name like this.

2. If you are using anonymous sessions, you can pass entry parameters into the program that is called, also using query string parameters. The IP address could be passed into the initial program in this case, and stored in a QTEMP file or data area, or even by using the LDA.

If either of those would work for you, let me know and I can post some information on how to use those features.

Re: obtaining device ip address.

Posted: Wed May 25, 2011 9:54 am
by chris_rover
Hi David,
we are exploring the 2 options you have suggested. can you provide some information on how to use these features?
thanks in advance.

Re: obtaining device ip address.

Posted: Wed May 25, 2011 10:12 am
by David
See the attached documents.