SMART disk failure data
We can access the SMART disk failure data using
Get-WmiObject -Namespace root\wmi -Class MSStorageDriver_FailurePredictData
The important properties are:
Active : True
InstanceName : IDE\DiskST9250320AS_____________________________HP07____\5&b0fd174&0&1.0.0_0
Length : 512
VendorSpecific : {10, 0, 1, 15...}
The data we want is in the VendorSpecific property. On my system its an array of 512 numbers – not very useful but we can (hopefully) decode this
function get-diskstatus {
[CmdletBinding()]
param (
[string]$computername = $env:COMPUTERNAME
)
$items = "Unknown1","Unknown2", "Attribute", "Status", "Unknown3", "Value", "Worst", "Raw1", "Raw2", "Unknown4","Unknown5","Unknown6"
$data = Get-WmiObject -Namespace root\wmi -Class MSStorageDriver_FailurePredictData -ComputerName $computername
#$data | select InstanceName, Active
$values = $data.VendorSpecific
$flb = $values.Count - ($values.Count % 12) -1
for ($i = 0; $i -le $flb-11; $i += 12 ){
$obj = New-Object -TypeName PSObject
for($j = 0; $j -le 11; $j++) {
$obj | Add-Member -MemberType Noteproperty -Name $($items[$j]) -Value $($values[$i + $j])
}
$obj
}
}
We can use this as
get-diskstatus | ft * –a
I only have a single disk in my system so this works – I’ll need to modify the function to deal with multiple disks
But this is what I get back
Unknown1 Unknown2 Attribute Status Unknown3 Value Worst Raw1 Raw2 Unknown4 Unknown5 Unknown6
-------- -------- --------- ------ -------- ----- ----- ---- ---- -------- -------- --------
10 0 1 15 0 114 99 62 168 88 4 0
0 0 3 2 0 99 99 0 0 0 0 0
0 0 4 51 0 99 99 95 5 0 0 0
0 0 5 51 0 100 100 17 0 0 0 0
0 0 7 15 0 81 60 227 94 126 8 0
0 0 9 50 0 90 90 132 34 0 0 0
0 0 10 19 0 100 100 0 0 0 0 0
0 0 12 51 0 99 99 248 4 0 0 0
0 0 184 51 0 100 100 0 0 0 0 0
0 0 187 50 0 100 100 0 0 0 0 0
0 0 188 50 0 100 99 11 0 0 0 0
0 0 189 58 0 100 100 0 0 0 0 0
0 0 190 34 0 56 51 44 0 20 45 0
0 0 191 50 0 100 100 54 0 0 0 0
0 0 192 50 0 100 100 0 0 0 0 0
0 0 193 50 0 96 96 166 34 0 0 0
0 0 194 34 0 44 49 44 0 0 0 16
0 0 195 26 0 51 49 62 168 88 4 0
0 0 196 51 0 100 100 17 0 0 0 0
0 0 197 18 0 100 100 0 0 0 0 0
0 0 198 16 0 100 100 0 0 0 0 0
0 0 199 62 0 200 200 0 0 0 0 0
0 0 254 50 0 100 100 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 200 2 0 115 3 0 1 0
2 92 3 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 4 1 1 1
1 1 1 1 1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 0 0
54 0 0 0 33 186 100 101 238 28 0 0
0 0 0 0 1 0 189 1 172 221 133 205
35 0 0 0 154 12 230 180 219 1 0 0
0 0 0 0 0 187 32 0 0 0 0 0
0 0 0 0 105 36 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
Next job is to decode some of this information