fixed monitor-health command for pools containing cache and log devices

This commit is contained in:
Christoph Klaffl 2018-07-06 15:52:54 +02:00
parent 2224866da6
commit ba3836ec52
No known key found for this signature in database
GPG Key ID: FC1C525C2A47CC28
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