Skip to content

Commit 3fb1583

Browse files
committed
Fix: Df parsing for space processes
1 parent 162466d commit 3fb1583

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

inspector/disk.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,14 @@ func (i *DF) Parse(output string) {
7979
log.Fatalf(`Error Parsing Percent Full: %s `, err)
8080
}
8181
// find size
82-
for index := range columns {
83-
_, err := strconv.ParseInt(columns[index], 0, 64)
82+
originalColumns := columns
83+
for index := range originalColumns {
84+
_, err := strconv.ParseInt(originalColumns[index], 0, 64)
8485
if err == nil {
85-
columns[0] = strings.Join(columns[:index], " ")
86-
columns[1] = columns[index]
86+
columns[0] = strings.Join(originalColumns[:index], " ")
87+
columns[1] = originalColumns[index]
88+
columns[2] = originalColumns[index+1]
89+
columns[3] = originalColumns[index+2]
8790
break
8891
}
8992
}
@@ -138,7 +141,8 @@ type DFWin struct {
138141
Values []DFMetrics
139142
}
140143

141-
/* Parse : For the following windows output
144+
/*
145+
Parse : For the following windows output
142146
143147
Node,DeviceID,DriveType,FreeSpace,ProviderName,Size,VolumeName
144148
IMANI,C:,3,191980253184,,288303964160,OS

0 commit comments

Comments
 (0)