summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 79ee3b9)
raw | patch | inline | side by side (parent: 79ee3b9)
author | M. Sean Finney <seanius@users.sourceforge.net> | |
Wed, 7 Jun 2006 14:28:33 +0000 (14:28 +0000) | ||
committer | M. Sean Finney <seanius@users.sourceforge.net> | |
Wed, 7 Jun 2006 14:28:33 +0000 (14:28 +0000) |
logic in check_linux_raid.pl
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1418 f882894a-f735-0410-b71e-b25c423dba1c
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1418 f882894a-f735-0410-b71e-b25c423dba1c
contrib/check_linux_raid.pl | patch | blob | history |
index 85d5dc4a8da5c6a697765ad9773bb8d76031e146..11bc3cdcacc9cd7c5629b63fa90bcbedc5b09863 100644 (file)
#
# Usage: check_raid [raid-name]
# Example: check_raid md0
-# WARNING md0 status=[UUU_U], recovery=46.4%, finish=123.0min
+# WARNING md0 status=[UUU_U], recovery=46.4%, finish=123.0min
use strict;
use lib utils.pm;
if (defined $device) {
if (/(\[[_U]+\])/) {
$status{$device} = $1;
- $device = undef;
} elsif (/recovery = (.*?)\s/) {
$recovery{$device} = $1;
($finish{$device}) = /finish=(.*?min)/;
- $device = undef;
+ } elsif (/^\s*$/) {
+ $device=undef;
}
- } else {
- if (/^($nextdev)\s*:/) {
- $device=$1;
- $devices{$device}=$device;
- if (/active/) {
- $active{$device} = 1;
- }
+ } elsif (/^($nextdev)\s*:/) {
+ $device=$1;
+ $devices{$device}=$device;
+ if (/active/) {
+ $active{$device} = 1;
}
}
}
foreach my $k (sort keys %devices){
if ($status{$k} =~ /_/) {
- if ($recovery{$k}) {
+ if (defined $recovery{$k}) {
$msg .= sprintf " %s status=%s, recovery=%s, finish=%s.",
$devices{$k}, $status{$k}, $recovery{$k}, $finish{$k};
$code = max_state($code, "WARNING");