Background
For a computer with multiple network adapters there will be multiple IP addresses recorded on table Inv_AeX_AC_TCPIP. We have found that it's pot-luck which (single) IP address is selected to represent a computer in Views such as: vComputer, vCMDBComputer, vITAnalytics_CMDB_ComputerDim etc.
This means when you are using these views to look for computers associated with a network, you won't reliably find computers based upon their primary network interface, because any of the other less significant network adapters may be selected instead of the primary one.
We have a complex network with multiple subnets, and most flavours of OS. Altiris Inventory solution is being used across multiple networks and many of our servers are attached to more than one network (Primary, Backup, ILO etc).
History
We found this to be a problem in Altiris 6.5 and adapted the vcomputer view to use a bespoke method of selecting the IP address according to some criteria we worked out to be about 90% reliable.
Our interim solution, implemented under Altiris 7.1 by copying view vITAnalytics_CMDB_ComputerDim to create a bespoke copy, included the following subquery:
LEFT JOIN
dbo.Inv_AeX_AC_TCPIP AS tcp
ON tcp._ResourceGuid = vc.ResourceGuid
AND tcp._id =
(SELECT TOP 1 t._id AS Expr1
FROM dbo.Inv_AeX_AC_TCPIP AS t
WHERE (vc.ResourceGuid = t._ResourceGuid)
AND (t.[IP Address] NOT IN
('127.0.0.1', '0.0.0.0', ''))
AND (NOT (t.[IP Address] IS NULL))
ORDER BY t.routable DESC, t.[Primary WINS Server] DESC)
This logic ensures we always get an IP if one exists, but where the adapter in Routable, and/or has a Primary WINS server, it would be the "Top 1" that would be selected in preference to all others.
The Default Gateway issue
To get to 100% reliable we were told by our System Admins that we should use the Default Gateway. Only the primary network adapter will report the default gateway and no more than one network adapter at a time can report as having a default gateway.
When we investigated the data on table Inv_AeX_AC_TCPIP, we found that multiple network adapters for the same computer were reporting as having a default gateway. Having raised this with our assigned engineer, we concluded that the agent would occassionally pick up the default gateway from another adapter and report it up in inventory returns. Each new piece of network adapter inventory suppliments the data already present, but does not remove or replace data that doesn't represent reality at that point in time.
Progress...
With ITMS 7.1 Sp2 MP1 Rollup V3 we received some changes to the way the off-the-shelf DB views addressed this problem. A new view called vTcpIpAddress now exists. It determines the (single?) primary IP address for a computer using some fairly complex SQL with multiple sub-queries. It uses "Routable" and "DHCPEnabled" to prioritise the network adapters.
My Questions
First Question: Can anyone confirm or deny that our information about the Default Gateway is valid? Is it appropriate to expect only one adapter to have a default gateway on a computer with multiple NIC's across all the different flavours of computer OS?
Second Question: Has anyone found a more reliable method of finding the "primary" IP address for any given computer and is prepared to share it?
Third Question: I'm going to do some experiments internally, but can anyone with good sysadmin knowledge comment on the SQL behind the new view and confirm/deny how reliable it is likely to prove?