VMware Cloud Community
Sivaramsharmar
Enthusiast
Enthusiast

ILO IP Address of ESXi Hosts

Hi All,

I have written below script to get vCenter Inventory.

But not able to get ILO IP Address, Could some one help me to get ILO IP Address by modifying below script.

Thanks in Advance.

$allhosts = @()

$hosts = Get-VMHost

foreach($vmHost in $hosts){

$vmnic = $vmhost | Get-VMHostNetworkAdapter | where{$_.PortGroupName -eq "Management Network"}

$sn = $vmhost| Get-View | select -ExpandProperty Hardware | select -ExpandProperty SystemInfo | select -ExpandProperty OtherIdentifyingInfo |

where{$_.IdentifierType.Key -eq "ServiceTag"}

$dc = $vmhost | get-Datacenter

$cpu = $vmhost | Get-View | select -ExpandProperty Hardware | select -ExpandProperty CpuInfo | select NumCpuPackages

$ncpu = $cpu.NumCpuPackages

$cpuCore = $vmhost | Get-View |  select -ExpandProperty Hardware | select -ExpandProperty CpuInfo | select NumCpuCores

$ncc = $cpucore.NumCpuCores

$ncpucores = $ncc/$ncpu

$vc = $global:defaultVIServers | select Name

$vmnics = $vmhost | get-vmhostnetworkadapter -physical

$nic = $vmnics.count

$uvmnics = $vmhost | get-vmhostnetworkadapter -physical | where {$_.FullDuplex -eq 'True'}

$unic = $uvmnics.count

$dwwn1 = $vmhost| Get-VMHostHBA -Type FibreChannel | Select VMHost,Device,@{N="WWN";E={"{0:X}" -f $_.NodeWorldWideName}} | where{$_.Device -match "vmhba"} | select -Index 0

$dwwn2 = $vmhost| Get-VMHostHBA -Type FibreChannel | Select VMHost,Device,@{N="WWN";E={"{0:X}" -f $_.NodeWorldWideName}} | where{$_.Device -match "vmhba"} | select -Index 1

$wwn1 = $vmhost | Get-VMHostHBA -Type FibreChannel | Select VMHost,Device,@{N="WWN";E={"{0:X}" -f $_.PortWorldWideName}} | where{$_.Device -match "vmhba"} | select -Index 0

$wwn2 = $vmhost | Get-VMHostHBA -Type FibreChannel | Select VMHost,Device,@{N="WWN";E={"{0:X}" -f $_.PortWorldWideName}} | where{$_.Device -match "vmhba"} | select -Index 1

  $hoststat = "" | Select VC,DataCenter,Cluster,HostIP,HostName,Make,Model,SerialNumber,Socket,CPUCores,RAM,NoofNicPorts,NoOfNicUsedPorts,DeviceWWN1,WWPN1,DeviceWWN2,WWPN2

  $hoststat.vc = $vc.name

  $hoststat.HostName = $vmHost.name

  $hoststat.DataCenter = (get-datacenter -vmhost $vmhost.name)

  $hoststat.Cluster = $vmhost.parent

  $hoststat.HostIP = $vmnic.IP

  $hoststat.HostName = $vmhost.Name

  $hoststat.Make = $vmhost.Manufacturer

  $hoststat.Model = $vmhost.Model

  $hoststat.SerialNumber = $sn.IdentifierValue

  $hoststat.Socket = $cpu.NumCpuPackages

  $hoststat.CPUCores = $ncpucores

  $hoststat.RAM = [int]$vmhost.MemoryTotalGB

  $hoststat.NoofNicPorts = $nic

  $hoststat.NoOfNicUsedPorts = $unic

  $hoststat.DeviceWWN1 = $dwwn1.wwn

  $hoststat.WWPN1 = $wwn1.wwn

  $hoststat.DeviceWWN2 = $dwwn2.wwn

  $hoststat.WWPN2 = $wwn2.wwn

  $allhosts += $hoststat

}

$allhosts | Select VC,DataCenter, Cluster,HostIP,HostName,Make,Model,SerialNumber,Socket,CPUCores,RAM,NoofNicPorts,NoOfNicUsedPorts,DeviceWWN1,WWPN1,DeviceWWN2,WWPN2 | export-csv vi.csv

0 Kudos
6 Replies
LucD
Leadership
Leadership

0 Kudos
Sivaramsharmar
Enthusiast
Enthusiast

Hi Lucd,

Below URL is no more available.

http://blogs.vmware.com/vipowershell/2009/03/monitoring-esx-hardware-with-powershell.html

Another URL is available by explaining OMC_IPMIIPProtocolEndpoint, but I am not able to understand as I am beginner in Powercli, Please suggest.

https://www.vmware.com/support/developer/cim-sdk/smash/u3/ga/apirefdoc/OMC_IPMIIPProtocolEndpoint.ht...

0 Kudos
LucD
Leadership
Leadership

Is the script in http://www.vpeeling.com/?p=235 returning the required information ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Sivaramsharmar
Enthusiast
Enthusiast

Hi Lucd,

http://www.vpeeling.com/?p=235

In This URL They already have ILO IP Address along with MAC Address,I hope it is for HP Servers but We are having DELL R720 Servers.

I cannot execute the script as I don't have the ILO and MAC Address in CSV file.

Please suggest.

0 Kudos
Zsoldier
Expert
Expert

Does this help?

http://tech.zsoldier.com/2014/04/get-idracilo-aka-baseboard-management.html

Chris Nakagaki (中垣浩一)
Blog: https://tech.zsoldier.com
Twitter: @zsoldier
0 Kudos
Sivaramsharmar
Enthusiast
Enthusiast

Hi Chris,

I am executing the command like below as per Zsoldier's Tech Blog: Get iDRAC/ILO (aka Baseboard Management Controller) IP via PowerCLI

Get-VMHostWSManInstance -VMHost (Get-VMHost ESXi1.domain.com) -ignoreCertFailures -class OMC_IPMIIPProtocolEndpoint

But I am getting Basic Authentication Error.

ESXi 5.5 with HP Gen 8 Servers we are using.

Please suggest.

0 Kudos