5 Replies Latest reply on Apr 15, 2010 1:40 PM by Will Rodina

    Server name... help?

      Taking a look through some servers in our CM console, I am finding some that appear to be having an identity crisis of sorts:

       

      Name Property:    NCM-TPC.domain1.net
      Hostname:         wtpcpsmdfm01
      FQ_HOST Property: wtpcpnmdfm01.domain2.com
      HOST Property:    NCM-TPC.domain1.net

       

      Now obviously, the Name property was specified on our end, so I understand where that comes from. Hostname in this case is taken from the output of the agentinfo command. FQ_HOST and HOST are intrinsic server properties. (I also noted that Hostname and FQ_HOST differ on the sixth letter, being an "s" in Hostname and an "n" for FQ_HOST.)

       

      Just wondering where the agent gets each of these different names, and why they would all be different yet still point to the same server. To the best of my knowledge, there isn't anything wacky going on with IP addressing or anything (e.g. multiple servers sharing an IP)... so this gets to be a bit baffling trying to keep it all sorted out.

       

      The server itself (Windows OS, that is) believes that it is named WTPCPSMDFM01, which jives with the Hostname above. We are trying to get that saved as a server property that we can manipulate via the console... is there any way to do that?

       

      (Hm, two questions in the same thread. Hope I don't get charged extra!) 

        • 1. Re: Server name... help?

          I would say there is some DNS issue out there. Do a few nsloookups against different DNS servers for the IP of that server and see what turns up.

          • 2. Re: Server name... help?

            NAME property was defined when you register the server in BL.

            HOST property = NAME property, host property isn't setup by an hostname request on properties update.

            FQ_HOST Property is updated (when you run an Update Sever properties job) by the result of a reverse lookup on the server IP, reverse lookup run from the application server so depending of resolution name of the application server.

             

            Difference between Hostname and FQ_HOST property at the hostname level should become from a misstaping in the DNS entry.

             

            If you want to setup a property on SERVER class that will contain the "real" hostname (the one you get when you run hostname command on the server), you should follow this process:

                 - create a HOSTNAME property in the SERVER properties class

                 - write a NSH script you store in depot as type one (runscript) that will put the result of hostname command on target inside the HOSTNAME property.

                 -  create a NSH job that you will run on Server group containing servers where you want to have the property setup.

                 - if hostname could change, run the job on regular basis

                 - run this job on each new registered server.

             

            I hope this help.

            • 3. Re: Server name... help?

              Thank you for the responses. Internal DNS on our network is... "creative"... and also outside our group's control. So we may not have much there we can do (unfortunately).

               

              If you want to setup a property on SERVER class that will contain the "real" hostname (the one you get when you run hostname command on the server), you should follow this process:

                   - create a HOSTNAME property in the SERVER properties class

                   - write a NSH script you store in depot as type one (runscript) that will put the result of hostname command on target inside the HOSTNAME property.

                   -  create a NSH job that you will run on Server group containing servers where you want to have the property setup.

                   - if hostname could change, run the job on regular basis

                   - run this job on each new registered server.

               

              That's kind of what I figured -- I have a job set up to do just that, but the problem I'm having with that job is that it is not passing the full server name to the script with the %h macro. In other words, servers that have the FQDN as the Name are not able to be updated.

               

              I have a separate thread in the Scripting forum on that topic, so far no hits on that one: http://communities.bmc.com/communities/thread/41764

              • 4. Re: Server name... help?

                You won't need to use the %h with nsh script type one, and as you will target the job on the server group or server, the ip resolution will be done using what you've in NAME property.

                 

                So you can use the following script:

                 

                #!/bin/nsh
                #
                #
                # script:  load_hostname_property.nsh
                #
                # Description: This script setup the value got by hostname command in
                #       HOSTNAME server property.
                #    
                #######################################################################
                #  MODIFY DATE   MODIFIED BY   REASON FOR & DESCRIPTION OF MODIFICATION
                #  -----------  -------------  ----------------------------------------
                #  04/15/06    Fred Breton    Created
                ########################################################################

                # Getting the value in the name property
                HOST=$NSH_RUNCMD_HOST

                # Real hostname value
                HOSTNAME=$(hostname)

                blcli_execute Server setPropertyValueByName $HOST HOSTNAME $HOSTNAME

                 

                Put it on the depot as NSH script type 1:

                SCShot  .jpg

                 

                That should make the job.

                 

                Fred.

                 

                • 5. Re: Server name... help?

                  Looks good, that is effectively the method I was hoping to use. (My script is a bit different, but appears to function the same way.)

                   

                  Thanks again for the help, it is duly appreciated.