glensc / nagios-plugin-check_raid

Nagios/Icinga/Sensu plugin to check current server's RAID status ⛺
144 stars 84 forks source link

mdstat: Check if a certain amount of spares are present #185

Closed chschenk closed 5 years ago

chschenk commented 6 years ago

This pull request adds a plugin option to check if a certain amount of spares in an md array are present:

Example: check_raid --plugin-option=mdstat_spare_count="md126:3,md127:2"

checks that md126 has at least 3 spares and that md127 has at least 2 spares

glensc commented 5 years ago

can you add some tests to the new code paths?

chschenk commented 5 years ago

I have added some test data and some tests. What do you think on this PR? Any chance to get this included?

glensc commented 5 years ago

looks like my previous comment was never posted

the tests pass, so looks good.

ideally i'd not make the methods even longer, but use subroutines. but the cleanup can be done later as well.

glensc commented 5 years ago

I wonder how would users find the options/features like this?

Do you mind writing some pod documentation to specific plugin header?

this would be first plugin having such doc, so you can be creative ;)

glensc commented 5 years ago

you can grab new version from snapshot build