Below is the algorythm NNM uses to define the hostname, It is not dependent on which interface was discovered first but on the ruleset below.
NNM Naming Algorithms
Many questions have been asked as to how NNM names and labels the objects and symbols - Well here are some answers.
For the two categories the lists are checked in increasing numerical order (ie down the list ) and as soon as there is a match, we have the name to use.
Object Naming NNM 4.1x Named Software Loopback Interface (not 127.0.0.1 ) Lowest named IP Address Lowest Software loopback IP address Lowest non-migrateable IP Address LLa address ( mac Address ) A migrateable name The current name ( if one already present) The UUID NNM 5.0x/6.0x Named Software Loopback Interface (not 127.0.0.1 ) Lowest named IP Address Lowest Software loopback IP address Lowest non-migrateable IP Address Use the IPX server address Use "lowest" IPX address LLa address ( mac Address ) A migrateable name The current name ( if one already present) The UUID
Symbol Labeling Nodes NNM 4.1x if the nodename doesn't start with a digit strip everything after and including the first "." otherwise use the nodename NNM 5.0x/6.0x if IP and nodename doesn't start with a digit, strip after first "." and use if IPX and hasServerName or isaServer and has a Server address use it. If it has a sysname ( not starting with digit ) use it if its IP use its IP address if its IPX and has an ipxaddress use it if it has a mac address use it or use the nodename ( selection name ). Interfaces Note with the interfaces will be named initially using the first non-whitespace characters in the ifDescr ( .18.104.22.168. 22.214.171.124.1.2) for the interface.
If the agent supports the ifMIB ( the extended mib ) then at the first config check ( nmdemandpoll etc ) the name in the ifName (.126.96.36.199.188.8.131.52.1.1.1) variable will be used.
Why do we do this ? Well the Description for the ifDescr variable is :
A textual string containing information about the interface. This string should include the name of the manufacturer, the product name and the version of the interface hardware/software.
while that for the ifName is
The textual name of the interface. The value of this object should be the name of the interface as assigned by the local device and should be suitable for use in commands entered at the device's `console'. This might be a text name, such as `le0' or a simple port number, such as `1', depending on the interface naming syntax of the device. If several entries in the ifTable together represent a single interface as named by the device, then each will have the same value of ifName. If there is no local name, or this object is otherwise not applicable, then this object contains a 0-length string.
ifDescr has been used in the past since this originally was the only place where we could get some form of name for the interface. With the introduction of the ifMIB, we now have a proper variable for the name of the interface.