Is there a way to export the status of all Power Supplies for all of our ESX Hosts?
Is this something that I can export to a csv file:
Thanks in advance!
You said PowerCli and this will export the data to a csv:
$vmhosts = get-vmhost
$results = @()
foreach($vmhost in $vmhosts){
(Get-View (Get-VMHost -Name $vmhost | Get-View).ConfigManager.HealthStatusSystem).ResetSystemHealthInfo()
(Get-View (Get-VMHost -Name $vmhost | Get-View).ConfigManager.HealthStatusSystem).RefreshHealthStatusSystem()
$result = ((Get-View $vmhost).runtime.healthsystemruntime.systemhealthinfo.numericsensorinfo) |
where{$_.name -like '*power*'}|
select @{Name='VMHost';Expression={$vmhost.Name}},name,@{Name='Sensordata';Expression={$_.healthstate.label}},currentreading,baseunits
$results += $result
}
$results | Export-Csv -Path c:\PATH_TO_SAVE_CSV.csv -NoTypeInformation
Select ESXi host >>> go to Hardware status Tab >> in top right corner , there is a option to "export" >>> it'll save data in xml file.
later on use xml file to csv or excel converter.
You said PowerCli and this will export the data to a csv:
$vmhosts = get-vmhost
$results = @()
foreach($vmhost in $vmhosts){
(Get-View (Get-VMHost -Name $vmhost | Get-View).ConfigManager.HealthStatusSystem).ResetSystemHealthInfo()
(Get-View (Get-VMHost -Name $vmhost | Get-View).ConfigManager.HealthStatusSystem).RefreshHealthStatusSystem()
$result = ((Get-View $vmhost).runtime.healthsystemruntime.systemhealthinfo.numericsensorinfo) |
where{$_.name -like '*power*'}|
select @{Name='VMHost';Expression={$vmhost.Name}},name,@{Name='Sensordata';Expression={$_.healthstate.label}},currentreading,baseunits
$results += $result
}
$results | Export-Csv -Path c:\PATH_TO_SAVE_CSV.csv -NoTypeInformation
Thank you sir!
Exactly what I need.