1 2 Previous Next 24 Replies Latest reply on Feb 7, 2018 8:53 AM by Fred Grooms

    How discover client's IP or hostname?

    Rolf Cooke

      While user is viewing AR for via MidTier, how can one discover the IP or hostname of the machine from which they visit?  I believe all PCs will be on Intranet.


      Rolf

        • 1. Re: How discover client's IP or hostname?

          In AR System 7.1.00, the web client IP addresses of users are now retained in the user log (at the INFO log level).

          If you turn on logging from the BMC Remedy Mid Tier Configuration Tool, you can select the level of detail you want to receive: Fine, Info (new to version 7.1.00), Warning, or Severe.

          If you create log files with a Fine or Info level, the log file will contain the client IP address.

          For more information, see the Installing and Administering BMC Remedy Mid Tier guide.

          Note that this is the IP address provided to the Mid-Tier and may not be the actual IP of the client due to NAT or spoofing. 



          Thanks,
           
          David J. Easter
          Product Line Manager, AR System
          BMC Service Management Business Unit

          • 2. Re: How discover client's IP or hostname?
            Rolf Cooke

            Is there some way this data can be collected via workflow and inserted into a field on the form being displayed?

            • 3. Re: How discover client's IP or hostname?
              Aditya Kovur

              Try the Following in a set field action.

              From the User Tool you can do a Set Fields Action to get the host name:
                 $zHostName$ (or whatever you name the field) = $PROCESS$ %COMSPEC% /c
              echo %COMPUTERNAME%

              For the IP you can do:
                 $zLocalIP$ (or whatever you name the field) = $PROCESS$ %COMSPEC% /c
              ipconfig
              You will have to parse out the IP from the result

              Regards,
              Aditya K

              1 of 1 people found this helpful
              • 4. Re: How discover client's IP or hostname?
                Rolf Cooke

                The information provided is helpful; but will this work in MidTier, too?

                If not, then what would be helpful in MidTier while user is viewing form from their PC?

                • 5. Re: How discover client's IP or hostname?
                  Aditya Kovur

                  Hi ,

                  I guess it will work for mid tier tooo but I am not sure though. Check this once and do let me know.

                  Regards,
                  Aditya

                  • 6. Re: How discover client's IP or hostname?

                    Hi,

                    I don't think that will work on the midtier because of security model in the browsers, plus, it is for Windows OS only.

                    You could possibly use client side javascript, or, if your server is IIS, the iis request object.

                    A bit short of time to write a sample, but that should get you started.

                    Cheers
                    /P

                    • 7. Re: How discover client's IP or hostname?

                      You could trigger some javascript or some other code to findout the IP address of the client

                      • 8. Re: How discover client's IP or hostname?
                        Rolf Cooke

                        I acquired understanding of how to use JavaScript and supporting JSP.  I now have a JavaScript embedded in the form header that acquires the IP.  I attempted to capture machine name, but this resolved as IP due to inability to use DNS (evidently).  Nonetheless, the requirement was for IP only.  Also, since all PCs are on Intranet, there is no firewall or other device that is having its IP reported instead (from what we can gather).

                        Rolf

                        • 9. Re: How discover client's IP or hostname?

                          Hello Rolfcooke.

                          Might you want to share the Javascripts you are using?

                          Thanks, Robert

                          • 10. Re: How discover client's IP or hostname?
                            Rolf Cooke

                            Attached is hte JSP file I am now using.  The contents of the file are below.

                            ==========\
                            function env_ip_var()
                            {
                             var return_value = "<%=request.getRemoteAddr()%>";
                             return (return_value)
                            }
                            function env_hostname()
                            {
                             var return_value = "<%=request.getRemoteHost()%>";
                             return (return_value)
                            ==========\

                            Below is the line embedded within the page header.
                            ==========\
                            <SCRIPT src="/arsys/shared/get_client_info.jsp" language="JavaScript"></SCRIPT>
                            ==========\


                            For the set fields operation, below is the content of the active link's RUN PROCESS.
                            ==========\
                            JAVASCRIPT:window.F(720100313).DoSet(env_ip_var());
                            ==========\


                            For our purpose, the operation is run on Window Open.  It sets field, identified by field ID 720100313, with results of JAVASCRIPT function called.

                            1 of 1 people found this helpful
                            • 11. Re: How discover client's IP or hostname?

                              Thank you! and that is working for us.

                              However, would like to get the computer name of the current users. When using the return value of env_hostname(), we too get the IP only as well.

                              Anyone how to bypass that?

                              I tried adding a Java funnction like this:
                               
                              ==========
                              function java_hostname2()
                               {
                               localhost = java.net.InetAddress.getLocalHost();
                               hostaddress = localhost.getHostAddress();
                               hostname = localhost.getHostName ();
                               return (hostname)
                               }
                              ==========

                              When trying to call this ad the Active Link with:
                              javascript:window.F(536870922).DoSet(java_hostname2());

                              I get the error message in Midtier:
                              Caught exception : 'java' is undefiend

                              I'm not really a coder, and was just copying that Java part (googl'ed that getting the Hostname of the user with Java is easier, or works, and this this can by included in Javascripts).

                              Any insides buy someone who knows better highly appreciated :-)


                              Thanks, Robert

                              • 12. Re: How discover client's IP or hostname?

                                Aditya- This worked perfectly, thank you for sharing this with us.  Quick question however.  I created an escalation to go in after the fact, and to update all records that have blank data for that particular field, using the set field process you shared.  However, even when the Run IF condition is met, the field was not updated.  Any ideas on that?

                                 

                                Scott

                                • 13. Re: How discover client's IP or hostname?

                                  Hello Rolf,

                                   

                                  Can you please let me know the whole process. I was trying to get the IP details with the command :

                                  $PROCESS$ %COMSPEC% /cipconfig as mentioned above. This is working fine in the User Tool but giving an error in midtier ARERR 9366. I dont have clear idea about how to run the Java script mentioned in your reply. Please let me know the file name where i need to copy the code mentioned.

                                   

                                  Thanks,

                                  Prawin .

                                  • 14. Re: How discover client's IP or hostname?
                                    Valerio Verdone

                                    Hi to all! I tried to use the ACTL solution and it works on client but not on Mid-Tier.

                                    Do you know if there is some enanchement in Remedy 8.1 version to achieve this result?

                                     

                                    Thank you in advance.

                                     

                                    Best regards

                                    1 2 Previous Next