PowerCLI and other API methods may report different sensor values for ESX/ESXi host status, as compared to the vSphere Client connected to vCenter Server.
Get-VMHost myesxhost |
% {(get-view $_.id).runtime.healthSystemRuntime.systemHealthInfo.NumericSensorInfo |
Where-Object {$_.HealthState.Label -notmatch 'Green'}}
Name : VMware Rollup Health State
HealthState : VMware.Vim.ElementDescription
CurrentReading : 0
UnitModifier : 0
BaseUnits :
RateUnits :
SensorType : system
DynamicType :
DynamicProperty :
This issue can occur when information being fetched is cached. The vmware-hostd management service refreshes hostd health information via CIM every 90 seconds, with back-off up to 10 minutes. The cache can be refreshed using the vSphere API call RefreshHealthStatusSystem() prior to retrieving health status information.
(Get-View (Get-VMHost -Name esxhostname | Get-View).ConfigManager.HealthStatusSystem).RefreshHealthStatusSystem()
(Get-View (Get-VMHost -Name esxhostname | Get-View).ConfigManager.HealthStatusSystem).ResetSystemHealthInfo()