Pages: [1]
Print
Author Topic: Getting CDP Information of vmnic  (Read 1753 times)
justStormY
Newbie
*
Posts: 1


View Profile
« on: February 13, 2009, 08:09:32 AM »

Hello all together,

i'm searching for something really special. I hope anybody can help me to solve this in here.

I want a script (powershell) that shows me for every ESX host in a VC the CDP (Cisco Discovery Protocol) Information of the vmnics.
Seems to be a really big problem to get this. I allready tried to get theese informations through the ESX hosts themselves. But it seems that not the ESX hosts retrieve this information but rather the VC. Right now i'm able to get the information on which vmnic CDP is enabled but not the information like Switchname, Switchport,.....

Do you have any ideas to get this? This would help me much! Thank you for helping!
Logged
esarakaitis
Administrator
Sr. Member
*****
Posts: 256


8223109 sack57@hotmail.com littleking57 rootinfortwayne
View Profile WWW Email
« Reply #1 on: February 13, 2009, 09:14:34 AM »

yes, you are asking for something really special. so special as it does not exist  Grin as cdp settings are not applied to vmnic's they are applied to vswitch's.

from there you can list vmnics from vswitches

its, quite easy to retrieve the information your looking for when it comes to virtual switches.
after about 3 seconds of searching here on this forum, i found this:

Code:
Get-VMHost | %{Get-View $_.ID} | %{$esxname = $_.Name; Get-View $_.ConfigManager.NetworkSystem} | %{
  foreach($physnic in $_.NetworkInfo.Pnic){
    $pnicInfo = $_.QueryNetworkHint($physnic.Device)
    foreach($hint in $pnicInfo){
      Write-Host $esxname $physnic.Device $hint.connectedSwitchPort
    }
  }
}
« Last Edit: February 13, 2009, 09:21:03 AM by esarakaitis » Logged
esarakaitis
Administrator
Sr. Member
*****
Posts: 256


8223109 sack57@hotmail.com littleking57 rootinfortwayne
View Profile WWW Email
« Reply #2 on: February 13, 2009, 09:22:51 AM »

are you talking about observed port ranges that the vmnic's see?
Logged
Pages: [1]
Print
Jump to: