Merge pull request #241 from phreaker0/fix-health-check-with-special

fixed monitor-health command for pools containing cache and log devices
This commit is contained in:
Jim Salter 2018-07-06 13:24:29 -04:00 committed by GitHub
commit 9ca09d516e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

7
sanoid
View File

@ -976,6 +976,11 @@ sub check_zpool() {
## other cases
my ($dev, $sta) = /^\s+(\S+)\s+(\S+)/;
if (!defined($sta)) {
# cache and logs are special and don't have a status
next;
}
## pool online, not degraded thanks to dead/corrupted disk
if ($state eq "OK" && $sta eq "UNAVAIL") {
$state="WARNING";
@ -1111,7 +1116,7 @@ sub checklock {
# make sure lockfile contains something
if ( -z $lockfile) {
# zero size lockfile, something is wrong
die "ERROR: something is wrong! $lockfile is empty\n";
die "ERROR: something is wrong! $lockfile is empty\n";
}
# lockfile exists. read pid and mutex from it. see if it's our pid. if not, see if