Sometimes it’s helpful to know which ports your host(s) are connected to on the switch(es), and it could be useful to know what kind of hardware used and – if possible – get the firmware/software version running on the switches. This can be retrieved by reading the information supplied by your switch, eighter via Cisco Discovery Protocol (CDP) or Link Layer Discovery Protocol (LLDP).
This information can be located using vSphere Client/Web Client browsing the CDP/LLDP information on the network interface, or by using a script. The script below will retreive this information, but there are some requirements that have to be met in order get something useful out of it.
1. The switches need to support CDP or LLDP and it needs to be enabled.
2. LLDP is only available when using Distributed Virtual Switch(es).
[snippet id=»30″]