let monitor-health check the capacity too

This commit is contained in:
Christoph Klaffl 2018-02-20 18:16:35 +01:00
parent f6519c0aea
commit 1f64c9c35a
No known key found for this signature in database
GPG Key ID: FC1C525C2A47CC28
1 changed files with 11 additions and 0 deletions

11
sanoid
View File

@ -798,6 +798,17 @@ sub check_zpool() {
## determine health of zpool and subsequent error status
if ($health eq "ONLINE" ) {
$state = "OK";
# check capacity
my $capn = $cap;
$capn =~ s/\D//g;
if ($capn >= 80) {
$state = "WARNING";
}
if ($capn >= 95) {
$state = "CRITICAL";
}
} else {
if ($health eq "DEGRADED") {
$state = "WARNING";