• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Get Client Hostname

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Get Client Hostname

    Hello,

    We have a situation where we would like to communicate with another machine based on the workstation that is processing a request. While we could use the RPG toolkit to get the client IP address using getSessVar, I'm not sure we can rely on the IP address not being dynamic. Would it be possible to also add a session variable for the client hostname?

  • #2
    Hi,

    Just to be clear you would like access to the clients “browser” hostname aka “IP or domain”?

    Thanks

    Comment


    • #3
      Sorry, my response was incorrect. Sounds like you want the name of the computer and if so, we do not have access to that because of security reasons. Same with the MAC address

      Comment


      • #4
        I figured that might be the case but I had to ask. Thank you.

        Comment


        • #5
          That's a real pity because I have the same need but for a different reason. We have green-screen programs that produce spooled output (labels), which get created in a printer OUTQ and the name of that OUTQ is dynamically determined based on the name of the workstation the user who is printing that label is on. Naturally I want to send that label to that printer sitting right next to him.

          Now, when you say the word 'workstation' above, I really do mean workstation, as in, 5250 device description name, session ID - that thing. That becomes the jobname of the user's interactive green-screen session. Thus, 'workstation' here is not synonymous to 'computer'. Many other folks think of PC / laptop / computer / machine etc. when the word "workstation" is mentioned.

          I'm just going to use the terms "session ID" and "computer". Forget workstation

          If you configure your emulator (ACS in our case) such that the session ID is derived from the computer name (using &COMPN), your program can determine the name of the user's computer the user is on, without having to fiddle with IP address and do a reverse DNS lookup. Your green screen program can substring the computer name out of the session ID and then go to some table and figure out which printer to use. It's a fragile solution that relies on strict adherence to established naming conventions. It works, until some user decides they don't like the session ID names that ACS assigns to their 5250 session and changes the ACS connection config. Or they get a new computer and end-user provisioning forgets to set that up in ACS and now they are running around with QPADEV000M sessions that don't map to anything.

          I don't want to map OUTQ's to USERID's because the user can be different on these computers on the production floor.

          The backend program that gets called from the Valence app to produce that spooled output needs to know what the name of the computer is that user is on who was running that Valence app. Other than doing a reverse DNS lookup of the IP address, do you have any other suggestions what to do?

          And speaking of that IP address, what's the best way to determine that? I was hoping to fetch it in the button helper program using ACTIVE_JOB_INFO but to my surprise it returns null for CLIENT_IP_ADDRESS. I guess I shouldn't be surprised about that, but that does work with QZDASOINIT jobs which in my mind are a lot like CGI jobs. Then I looked at VVSESSDTA.VVCLIENTIP but that has the IP address of the IBM i in it for all active sessions.

          If the only way to determine which machine an app is running on is via the IP address that's making the request, what's the best way to get the IP address?
          Last edited by DrGadget; 05-10-2022, 04:33 PM.

          Comment


          • #6
            ACS is an installed application so naturally it has access to the name of the device

            As for the sessions IP "VVSESSDTA.VVCLIENTIP" do you see the IBM i's IP address for sessions via the Active Sessions application?

            Comment


            • #7
              Yup, on every single user that has an active session, the IP address shown there (and in VVSESSDATA) is the IP address of my IBM i

              Session ID
              CJRH2HN0QTDSZGRDX3X2ZUE9GIOE3CRPXKYLS7JNN8JJH0D84V BH4QRBGICWFJXE
              IP Address
              10.108.1.10
              Login Method
              IBMI
              Language
              en
              Browser
              Chrome 100.0
              OS
              Windows 10


              ping SIERRA (my IBM i)

              Message . . . . : Verifying connection to host system SIERRA.SANTACLAUS.COM
              at address 10.108.1.10.

              Comment

              Working...
              X