How do I force OC to use only shortnames when doing discovery?
search cancel

How do I force OC to use only shortnames when doing discovery?

book

Article ID: 34611

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

It is often possible, though not always simple, to control the display of Operator Console (OC) Inventory hostnames through a careful configuration of the robots, probes, QoS profiles, and so forth in the environment; However, certain probes and types of discovery will nearly always return the FQDN no matter what configuration changes are attempted.

Therefore, it is often desirable to force the discovery_server to use the shortname when populating the discovery tables, so that all systems will appear in a consistent manner in the OC.

(Note that the reverse is generally not possible - we cannot "force" discovery_server to always use the FQDN.  This is because using the FQDN when one has been discovered is the default behavior; therefore, if a machine is not showing up with FQDN it generally means we were unable to discover the FQDN in the first place.)

Environment

  • Component: discovery_server

Cause

.

Resolution

In order to force discovery_server to truncate all FQDN's into shortnames/hostnames, you must use a LUA script which applies the desired changes to the incoming discovery information; such a script has been attached to this article.

To implement this script you will need to do the following:

1. deactivate the discovery_server
2. Place the script (called override_eval_name.lua) into the folder <Nimsoft root>\probes\service\discovery_server\scripts on your primary hub.
3. delete the rows from CM_COMPUTER_SYSTEM which correspond to machines that are currently displayed using FQDN.
4. activate discovery_server and wait for the systems to be re-discovered.   When re-discovered they will be populated into CM_COMPUTER_SYSTEM with the shortname.

NOTE: This applies to discovery 7.0 and later only.

Forcing discovery to use only shortnames

It is often possible, though not always simple, to control the display of hostnames through a careful configuration of the robots, probes, QoS profiles, and so forth in the environment; however, certain probes and types of discovery will nearly always return the FQDN no matter what configuration changes are attempted.

Therefore, it is often desirable to force the discovery_server to use the shortname when populating the discovery tables, so that all systems will appear in a consistent manner in the OC.

(Note that the reverse is generally not possible - we cannot "force" discovery_server to always use the FQDN. This is because using the FQDN when one has been discovered is the default behavior; therefore, if a machine is not showing up with FQDN it generally means we were unable to discover the FQDN in the first place.)

In order to force discovery_server to truncate all FQDN's into shortnames/hostnames, you must use a LUA script which applies the desired changes to the incoming discovery information; such a script has been attached to this article.

To implement this script you will need to do the following:

1. Deactivate the discovery_server
2. Place the script (called override_eval_name.lua) into the folder <Nimsoft root>\probes\service\discovery_server\scripts on your Primary hub.
3. Delete the rows from CM_COMPUTER_SYSTEM which correspond to machines that are currently displayed using FQDN.
4. Activate discovery_server and wait for the systems to be re-discovered. When re-discovered they will be populated into CM_COMPUTER_SYSTEM with the shortname.


------------------------------------------------------------------------------------
Contents of script override_eval_name.lua:
------------------------------------------------------------------------------------
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
=======================

Also, use Name Services resolution in the nas for resolving alarms that contain a hostname or IP, that you want to convert to a short name.

Select the Enable Name Services option to map the IP-addresses of the sources sending alarms to host names. Otherwise, the IP-address will be entered as the host name in the alarm messages.

Disable All other Name Services->Properties options. Just leave Enable Name services.

Check to make sure that ALL of your robot names are now short names.

Additional Information

If this is a result of migration deleting the entries in the nas "name service" will be required to resolve this issue.

Attachments

1558533987292TEC000004645.zip get_app