2 of 2 people found this helpful
In Discovery, we have relationships from both sides of the nodes. So the way you can traverse from Host to NetworkInterface, you will be able to traverse from NetworkInterface to Host.
If you want to get Host MAC address then I will suggest you to start from Host only to be efficient i.e you first approach.
Remember NetworkInterface node is also present on other root nodes like NetworkDevice, StorageDevice, Printer etc. So number of NetworkInterface nodes present might be much higher than number of Hosts and hence will not be efficient.
Just in case you are keen on getting query to start from NetworkInterface then you can consider below queries.
If you want list of Host:
search NetworkInterface traverse InterfaceOfDevice:DeviceInterface:DeviceWithInterface:Host show hostname as 'Hostname', #DeviceWithInterface:DeviceInterface:InterfaceOfDevice:NetworkInterface.interface_name as 'Interface Name', #DeviceWithInterface:DeviceInterface:InterfaceOfDevice:NetworkInterface.mac_addr as 'MAC Address', #DeviceWithInterface:DeviceInterface:InterfaceOfDevice:NetworkInterface.name as 'Name'
If you want list of Network Interfaces then you can run :
search NetworkInterface show interface_name, mac_addr, name as 'Interface Name with Host Name', #InterfaceOfDevice:DeviceInterface:DeviceWithInterface:Host.hostname as 'Hostname'
Thanks Saurabh, your explaination is very clear and percise.