Force discovery_server to always use short hostnames for new devices
search cancel

Force discovery_server to always use short hostnames for new devices

book

Article ID: 436909

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM) CA Unified Infrastructure Management On-Premise (Nimsoft / UIM) CA Unified Infrastructure Management SaaS (Nimsoft / UIM)

Issue/Introduction

How can we configure discovery_server to always use short name for new devices ?

Environment

  • DX UIM 23.4 CU7

Cause

  • Guidance

Resolution

To force UIM discovery_server to use short hostnames instead of Fully Qualified Domain Names (FQDN) for new devices, you must first adjust the naming priority in the probe's configuration, prioritizing the robot name or system name over the DNS name. 

Option 1 - Steps to force the use of short hostname by the discovery_server


  1. In IM or Admin Console, select the discovery_server probe, Shift+Rt-click, and select Raw Configure.

  2. Locate Naming Priority: Navigate to reconciliation -> display_name_priority

  3. Modify Order: The default value often prioritizes FQDN. Modify this key to place other.RobotName, other.SysName, or other.ComputerName at the beginning of the list.

  4. Cold start the discovery_server probe (Deactivate-Activate)


Additional Considerations

  • Discovery Agent Settings: If activated on the Primary of distributed to remote hubs, ensure the discovery_agent is not configured to force FQDN (dns) resolution. If a device has no DNS entry, it may fall back to IP address, which might be undesirable.

  • VMware Probe: If discovering via VMware, set use_guest_name_for_source to no and ensure the VM names in vSphere are short names.

  • Existing Data: These changes primarily affect newly discovered devices. 

  • Previously discovered devices may retain their FQDN in the CM_DEVICE tables. 

  • Note: UIM typically defaults to using the FQDN if it is available.

  • Warning: forcing a short name may result in the loss of QOS data continuity if the device was previously discovered with an FQDN. (you may have to merge some QOS data).

 

If the above doesn't work as thoroughly as you need it to, try the following:


Option 2 - To configure the discovery_server to use short names (hostnames) instead of Fully Qualified Domain Names (FQDN) for new devices, implement a LUA script that truncates incoming discovery information.

Steps:

  1. Deactivate the discovery_server probe

  2. Place the script named override_eval_name.lua into the following directory on your Primary Hub:

       \probes\service\discovery_server\scripts

  3. Delete the rows from the CM_COMPUTER_SYSTEM table that correspond to machines currently displayed with FQDNs.

  4. Activate the discovery_server

  5. When devices are re-discovered, they will be populated into the database using their shortname


LUA Script Content
The script logic typically follows this structure to split the name at the first period:

function eval_name()
  if computer_system.name then
    if computer_system.name == computer_system.ip_address then
      return(computer_system.name)
    end
    if string.find(computer_system.name, ".") then
      resultstable = mysplit(computer_system.name)
      local shortname=tostring(resultstable[1])
      return(shortname)
    end
  else
    return(computer_system.name)
  end
end

function mysplit(inputstr, sep)
  sep = "."
  local t={} ; i=1
  for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
    t[i] = str
    i = i + 1
  end
  return t
end