VMware Cloud Community
steve31783
Enthusiast
Enthusiast

Healthcheck Script Help

I would like to modify this existing Healthcheck Script...

http://communities.vmware.com/docs/DOC-7430

I like it almost exactly as it is, but I would like to modify the "ESX Hardware configuration" section to also include the server name (and maybe even the ESX version and build if possible) to include that info. for each line (that way I have an easy inventory of server name to hardware type, which this report does not do).

Can anyone help?

Also - Are there any other recommendations for SIMPLE powershell based healthcheck scripts?

0 Kudos
1 Reply
LucD
Leadership
Leadership

Replace this

#######################
# VMware ESX hardware #
#######################
Get-VMHost | Get-View | ForEach-Object { $_.Summary.Hardware } | Select-object Vendor, Model, MemorySize, CpuModel, CpuMhz, NumCpuPkgs, NumCpuCores, NumCpuThreads, NumNics, NumHBAs | ConvertTo-Html –title "VMware ESX server Hardware configuration" –body "<H2>VMware ESX server Hardware configuration.</H2>" -head "<link rel='stylesheet' href='style.css' type='text/css' />" | Out-File -Append $filelocation

by this

#######################
# VMware ESX hardware #
#######################
Get-VMHost | Get-View | ForEach-Object {$esx = $_; $_.Summary.Hardware } | Select-object @{N="Name";E={$esx.Name}},@{N="ESX version";E={$esx.Config.Product.Version}},Vendor, Model, MemorySize, CpuModel, CpuMhz, NumCpuPkgs, NumCpuCores, NumCpuThreads, NumNics, NumHBAs | ConvertTo-Html –title "VMware ESX server Hardware configuration" –body "<H2>VMware ESX server Hardware configuration.</H2>" -head "<link rel='stylesheet' href='style.css' type='text/css' />" | Out-File -Append $filelocation


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

0 Kudos