Automation

 View Only
  • 1.  Collect Core DUMP configuration

    Posted Nov 05, 2021 05:59 PM

    is there a way to collect the core dump configuration from all servers?

    I would like to collect the information in report via script, is that possible?

    if yes, can someone help me ?



  • 2.  RE: Collect Core DUMP configuration

    Posted Nov 05, 2021 06:19 PM

    Try with

    $esxcli = Get-EsxCli -VMHost MyEsx -V2
    $esxcli.system.coredump.network.get.Invoke()


  • 3.  RE: Collect Core DUMP configuration

    Posted Nov 05, 2021 06:51 PM

    I tried something like this, but I have a report collection issue

     

    #Connect to vCenter Server

    Connect-VIServer "vCenter@mylabs.local"

    $VMHosts= Get-VMHost | ? { $_.ConnectionState -eq "Connected"} | Sort-Object -Property Name
    $results= @()

    foreach($VMHost in $VMHosts) {
    $esxcli = Get-EsxCli -VMHost $VMHost -V2
    $esxcli.system.coredump.network.get.Invoke()

    }
    Export-Csv -Path .\coredump_Report.csv "VMHost" , "Enabled" , "HostVNic" , "IsUsingIPv6" , "NetworkServerIP" , "NetworkServerPort" -NoTypeInformation -UseCulture $results



  • 4.  RE: Collect Core DUMP configuration

    Posted Nov 05, 2021 07:28 PM

    The foreach statement doesn't place anything in the pipeline.
    Try something like this

    #Connect to vCenter Server
    
    Connect-VIServer "vCenter@mylabs.local"
    
    $VMHosts= Get-VMHost | ? { $_.ConnectionState -eq "Connected"} | Sort-Object -Property Name
    $results= @()
    
    foreach($VMHost in $VMHosts) {
      $esxcli = Get-EsxCli -VMHost $VMHost -V2
      $results += $esxcli.system.coredump.network.get.Invoke() |
        Select "VMHost" , "Enabled" , "HostVNic" , "IsUsingIPv6" , "NetworkServerIP" , 
          "NetworkServerPort"
    }
    
    $results | Export-Csv -Path .\coredump_Report.csv  -NoTypeInformation -UseCulture 


  • 5.  RE: Collect Core DUMP configuration

    Posted Nov 05, 2021 08:21 PM

    Thank you for your advise, I tested the script unfortunately the vmhost is empty not sure why 



  • 6.  RE: Collect Core DUMP configuration
    Best Answer

    Posted Nov 05, 2021 09:01 PM

    Then change the Select line to

      $results += $esxcli.system.coredump.network.get.Invoke() |
      Select-Object @{N='VMHost';E={$VMHost.Name}} , "Enabled" , "HostVNic" , "IsUsingIPv6" , "NetworkServerIP" ,
      "NetworkServerPort"