mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-26 00:27:45 -04:00
update check_linux_raid to take in consideration resync status and rise up a warning alert
This commit is contained in:
parent
b5cb208fdc
commit
130eb9635c
1 changed files with 13 additions and 2 deletions
|
|
@ -50,6 +50,7 @@ my $code = "UNKNOWN";
|
|||
my $msg = "";
|
||||
my %status;
|
||||
my %recovery;
|
||||
my %resyncing;
|
||||
my %finish;
|
||||
my %active;
|
||||
my %devices;
|
||||
|
|
@ -65,6 +66,10 @@ while(defined $nextdev){
|
|||
$recovery{$device} = $1;
|
||||
($finish{$device}) = /finish=(.*?min)/;
|
||||
$device=undef;
|
||||
} elsif (/resync =\s+(.*?)\s/) {
|
||||
$resyncing{$device} = $1;
|
||||
($finish{$device}) = /finish=(.*?min)/;
|
||||
$device=undef;
|
||||
} elsif (/^\s*$/) {
|
||||
$device=undef;
|
||||
}
|
||||
|
|
@ -95,8 +100,14 @@ foreach my $k (sort keys %devices){
|
|||
$code = max_state($code, "CRITICAL");
|
||||
}
|
||||
} elsif ($status{$k} =~ /U+/) {
|
||||
$msg .= sprintf " %s status=%s.", $devices{$k}, $status{$k};
|
||||
$code = max_state($code, "OK");
|
||||
if (defined $resyncing{$k}) {
|
||||
$msg .= sprintf " %s status=%s, resync=%s, finish=%s.",
|
||||
$devices{$k}, $status{$k}, $resyncing{$k}, $finish{$k};
|
||||
$code = max_state($code, "WARNING");
|
||||
} else {
|
||||
$msg .= sprintf " %s status=%s.", $devices{$k}, $status{$k};
|
||||
$code = max_state($code, "OK");
|
||||
}
|
||||
} else {
|
||||
if ($active{$k}) {
|
||||
$msg .= sprintf " %s active with no status information.",
|
||||
|
|
|
|||
Loading…
Reference in a new issue