Fix mdadm collector for resync=PENDING.
Add fix for mdadm devices in state `resync=PENDING`. * Update test and fixture.
This commit is contained in:
parent
61f36ac1ab
commit
64b82596ef
4 changed files with 11 additions and 1 deletions
|
|
@ -190,7 +190,7 @@ func parseMdstat(mdStatusFilePath string) ([]mdStatus, error) {
|
|||
|
||||
// If device is syncing at the moment, get the number of currently synced bytes,
|
||||
// otherwise that number equals the size of the device.
|
||||
if strings.Contains(lines[j], "recovery") || strings.Contains(lines[j], "resync") && !strings.Contains(lines[j], "resync=DELAYED") {
|
||||
if strings.Contains(lines[j], "recovery") || strings.Contains(lines[j], "resync") && !strings.Contains(lines[j], "resync=DELAYED") && !strings.Contains(lines[j], "resync=PENDING") {
|
||||
syncedBlocks, err = evalBuildline(lines[j])
|
||||
if err != nil {
|
||||
return mdStates, fmt.Errorf("error parsing mdstat: %s", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue