VMware Cloud Community
bernz
Enthusiast
Enthusiast

How to get ESXi host coredump partition?

Hi

I would like to get a xls or csv report that extract coredump partition, canonnical name and hostname of following list of host.

If no coredump active, it will show on the report not set or not configure.

Here's what I've started:

$Target = Get-Datacenter DCNAME | Get-VMHost | sort Name

Foreach ($vmhost in $Target) {

$esxcli = Get-EsxCli -VMhost $vmhost

#$esxcli.system.hostname.get()

$esxcli.system.coredump.partition.get()

}

Write-Host "Done" -ForegroundColor DarkGreen

This script only extract configured naa devices as coredump without hostname and validation.

2 Replies
LucD
Leadership
Leadership

Try like this

Get-Datacenter DCNAME | Get-VMHost | sort Name |

   ForEach-Object -Process {

     $esxcli = Get-EsxCli -VMhost $_ -V2

     $esxcli.system.coredump.partition.get.Invoke() |

    Select @{N = 'HostFQDN'; E = {$esxcli.system.hostname.get.Invoke().FullyQualifiedDomainName}},

       @{N = 'CoreDumpActive'; E = {

            if ($_.Active) {$_.Active}

            else {'None'}

      }

     },

   @{N = 'CoreDumpConfigured'; E = {

           if ($_.Configured) {$_.Configured}

           else {'None'}

       }

   }} |

   Export-Csv -Path .\coredump-report.csv -NoTypeInformation -UseCulture


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

bernz
Enthusiast
Enthusiast

thanks LucD

Reply
0 Kudos