|
@@ -81,24 +81,27 @@ func parseRAIDInfo(output string) *RAIDInfo {
|
|
|
case "Used":
|
|
|
raidInfo.UsedDevSize = fields[3]
|
|
|
case "Total":
|
|
|
- raidInfo.TotalDevices, _ = strconv.Atoi(fields[6])
|
|
|
+ raidInfo.TotalDevices, _ = strconv.Atoi(fields[3])
|
|
|
case "Persistence":
|
|
|
raidInfo.Persistence = strings.Join(fields[3:], " ")
|
|
|
case "Update":
|
|
|
updateTimeStr := strings.Join(fields[3:], " ")
|
|
|
- updateTime, _ := time.Parse("Mon Jan _2 15:04:05 2006", updateTimeStr)
|
|
|
+ updateTime, _ := time.Parse("Mon Jan 02 15:04:05 2006", updateTimeStr)
|
|
|
raidInfo.UpdateTime = updateTime
|
|
|
case "State":
|
|
|
raidInfo.State = fields[2]
|
|
|
case "Active":
|
|
|
- raidInfo.ActiveDevices, _ = strconv.Atoi(fields[2])
|
|
|
- raidInfo.WorkingDevices, _ = strconv.Atoi(fields[5])
|
|
|
- raidInfo.FailedDevices, _ = strconv.Atoi(fields[8])
|
|
|
- raidInfo.SpareDevices, _ = strconv.Atoi(fields[11])
|
|
|
+ raidInfo.ActiveDevices, _ = strconv.Atoi(fields[3])
|
|
|
+ case "Working":
|
|
|
+ raidInfo.WorkingDevices, _ = strconv.Atoi(fields[3])
|
|
|
+ case "Failed":
|
|
|
+ raidInfo.FailedDevices, _ = strconv.Atoi(fields[3])
|
|
|
+ case "Spare":
|
|
|
+ raidInfo.SpareDevices, _ = strconv.Atoi(fields[3])
|
|
|
case "Consistency":
|
|
|
raidInfo.Consistency = strings.Join(fields[3:], " ")
|
|
|
case "Name":
|
|
|
- raidInfo.Name = fields[2]
|
|
|
+ raidInfo.Name = strings.Join(fields[2:], " ")
|
|
|
case "UUID":
|
|
|
raidInfo.UUID = fields[2]
|
|
|
case "Events":
|