Hi,
The Esxi 6.5 hosts in our environment are hit by the issue as mentioned in the below KB article.
Host goes to non-responsive state - "IPMI SEL unavailable" (70973) (vmware.com)
I have written the below script to find out the impacted hosts, if any:
$esxlist = Get-VMHost | where {$_.version -eq "6.5.0"}
Foreach ($esxhost in $esxlist){
Write-Host "Please wait.....checking logs on $($esxhost.name)" -ForegroundColor Green
(get-log -vmhost $esxhost -key vmkernel).Entries | Where-object -FilterScript {$_ -match "IPMI SEL unavailable*"}
}
However it is return the entries like below:
2019-06-11T03:43:13.066Z error hostd[11403B70] [Originator@6876 sub=Cimsvc] IPMI SEL unavailable
Is there any easy way to capture only time stamp (2019-06-11T03:43:13.066Z) of that entry.
Please help.
You could do something like this
$text = '2019-06-11T03:43:13.066Z error hostd[11403B70] [Originator@6876 sub=Cimsvc] IPMI SEL unavailable'
[datetime]($text.Split(' ')[0])
In your script that could be something like this
$text = '2019-06-11T03:43:13.066Z error hostd[11403B70] [Originator@6876 sub=Cimsvc] IPMI SEL unavailable'
[datetime]($text.Split(' ')[0])
$esxlist = Get-VMHost | where {$_.version -eq "6.5.0"}
Foreach ($esxhost in $esxlist){
Write-Host "Please wait.....checking logs on $($esxhost.name)" -ForegroundColor Green
(Get-Log -VMHost $esxhost -Key vmkernel).Entries |
Where-object -FilterScript {$_ -match "IPMI SEL unavailable*"} |
Select @{N='TimeStamp';E={[DateTime]($_.Split(' ')[0])}}
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You could do something like this
$text = '2019-06-11T03:43:13.066Z error hostd[11403B70] [Originator@6876 sub=Cimsvc] IPMI SEL unavailable'
[datetime]($text.Split(' ')[0])
In your script that could be something like this
$text = '2019-06-11T03:43:13.066Z error hostd[11403B70] [Originator@6876 sub=Cimsvc] IPMI SEL unavailable'
[datetime]($text.Split(' ')[0])
$esxlist = Get-VMHost | where {$_.version -eq "6.5.0"}
Foreach ($esxhost in $esxlist){
Write-Host "Please wait.....checking logs on $($esxhost.name)" -ForegroundColor Green
(Get-Log -VMHost $esxhost -Key vmkernel).Entries |
Where-object -FilterScript {$_ -match "IPMI SEL unavailable*"} |
Select @{N='TimeStamp';E={[DateTime]($_.Split(' ')[0])}}
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Aah perfect. Thanks a lot.