1 Reply Latest reply on May 27, 2014 8:51 AM by Bill Robinson

    Swap server's short name with FQDN

    Santhosh Kurimilla

      Hi Bill Robinson/Communities,


      We have identified a list of Duplicate Servers' enrollments (with short name and FQDN) in our environment. We decided to keep only FQDNs and decommission the short names from the list. To accomplish this, we want to follow the below steps through NSH script:


      1. Identify the Jobs that are currently using these short names
      2. Remove the short names from the job and replace it with FQND of the same server
      3. Decommission the short names
      4. (Only If possible), send a mail to the job owners (User created/modified) that jobs are updated with FQDN


      We are unable to gather the jobs that are using a specific. Please note that we are still on 7.6 and we do not have getTargetServer(s) namespace in BLCLI. Any help would be greatly appreciated.



      Santhosh K

        • 1. Re: Swap server's short name with FQDN
          Bill Robinson

          you can query the database...


          select temp1.path,j.name,d.name from (select group_id, sys_connect_by_path( name, '|' ) path from blgroup start with parent_group_id = 0 connect by prior group_id = parent_group_id) temp1, job j

          join job_device jd on j.job_id = jd.job_id and j.job_version_id = jd.job_version_id

          join device d on jd.device_id = d.device_id

          where j.is_latest_version = 1

          and j.is_deleted = 0

          and j.is_saved_explicitly = 1

          and temp1.group_id = j.group_id;


          you can add a condition for the device.name in there at the end, or an 'in' clause for a few.


          you could include the job_id in the query and then feed the job_id to a blcli command to update the job.

          1 of 1 people found this helpful