Fix mdadm collector issues (#985)

* Send "Personality unknown" to debug, not info, remove unnecessary newline.
* Add support for "linear" personality.
* Always set number of active disks to 0 when a device is inactive.
* Add total disks calculation to unknown personalites.

Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
Ben Kochie 2018-07-02 12:38:20 +02:00 committed by GitHub
commit 107e5dfecc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 10 deletions

View file

@ -28,7 +28,7 @@ func TestMdadm(t *testing.T) {
"md3": {"md3", true, 8, 8, 5853468288, 5853468288},
"md127": {"md127", true, 2, 2, 312319552, 312319552},
"md0": {"md0", true, 2, 2, 248896, 248896},
"md4": {"md4", false, 2, 2, 4883648, 4883648},
"md4": {"md4", false, 0, 2, 4883648, 4883648},
"md6": {"md6", true, 1, 2, 195310144, 16775552},
"md8": {"md8", true, 2, 2, 195310144, 16775552},
"md7": {"md7", true, 3, 4, 7813735424, 7813735424},
@ -36,8 +36,9 @@ func TestMdadm(t *testing.T) {
"md10": {"md10", true, 2, 2, 314159265, 314159265},
"md11": {"md11", true, 2, 2, 4190208, 4190208},
"md12": {"md12", true, 2, 2, 3886394368, 3886394368},
"md120": {"md120", true, 2, 2, 2095104, 2095104},
"md126": {"md126", true, 2, 2, 1855870976, 1855870976},
"md219": {"md219", false, 0, 0, 7932, 7932},
"md219": {"md219", false, 0, 3, 7932, 7932},
"md00": {"md00", true, 1, 1, 4186624, 4186624},
}