[Pkg-nagios-devel] Bug#575382: Bug#575382: nagios-plugins-standard: check_linux_raid does not warn if resync is in process

Jan Wagner waja at cyconet.org
Sun Mar 28 22:02:28 UTC 2010


Hi Christoph,

On Sunday 28 March 2010, Christoph Martin wrote:
> Jan Wagner schrieb am 28.03.2010 22:19:
> > Hi Martin,
>
> s/Martin/Christoph/

sorry. :/

> If with raid6 a disk fails, a automatic recovery is done with one
> missing disk. With raid6 two disk may fail and the raid can be
> recovered. If you add a good disk, after the recovery a resync is done
> with state UUU_. Only after this resync it will get into state UUUU
> again. This resync should generate a warning.

Okay ... found an example, hopefully equivalent to your problem:

bb:~# cat /tmp/mdstat
Personalities : [raid1] [raid10]
md2 : active raid1 sdd2[4] sdc2[1] sdb2[2] sda2[0]
      16386176 blocks [4/3] [UUU_]
        resync=DELAYED

md1 : active raid1 sdd3[4] sdc3[1] sdb3[2] sda3[0]
      6144768 blocks [4/3] [UUU_]
        resync=DELAYED

md3 : active raid10 sdd4[4](F) sdc4[1] sdb4[5](F) sda4[0]
      1887974656 blocks 64K chunks 2 near-copies [4/2] [UU__]
      [==========>..........]  recovery = 50.3% (474987648/943987328) 
finish=4363639.0min speed=1K/sec

md0 : active raid1 sdd1[4](S) sdc1[5] sdb1[2] sda1[0]
      10241280 blocks [4/2] [U_U_]
        resync=DELAYED

unused devices: <none>

bb:~# /tmp/check_linux_raid md3
WARNING md3 status=[UU__], recovery=50.3%, finish=4363639.0min.
bb:~# /tmp/check_linux_raid_new md3
WARNING md3 status=[UU__], recovery=recovery, finish=4363639.0min.
bb:~# diff -Nur /tmp/check_linux_raid /tmp/check_linux_raid_new
--- /tmp/check_linux_raid	2010-03-28 23:19:08.000000000 +0200
+++ /tmp/check_linux_raid_new	2010-03-28 21:33:44.000000000 +0200
@@ -61,7 +61,7 @@
 		if (defined $device) {
 			if (/(\[[_U]+\])/) {
 				$status{$device} = $1;
-			} elsif (/recovery = (.*?)\s/) {  
+			} elsif (/(recovery|resync) = (.*?)\s/) {  
 				$recovery{$device} = $1;
 				($finish{$device}) = /finish=(.*?min)/;
 			} elsif (/^\s*$/) {

I don't see, how that should help. :) Did I miss something?

I just did have a closer look, what do you think about the following:

--- /tmp/check_linux_raid	2010-03-28 23:19:08.000000000 +0200
+++ /tmp/check_linux_raid_new	2010-03-28 23:48:11.000000000 +0200
@@ -50,6 +50,7 @@
 my $msg = "";
 my %status;
 my %recovery;
+my %resync;
 my %finish;
 my %active;
 my %devices;
@@ -64,6 +65,8 @@
 			} elsif (/recovery = (.*?)\s/) {  
 				$recovery{$device} = $1;
 				($finish{$device}) = /finish=(.*?min)/;
+			} elsif (/resync=(.*?)\s/) {
+				$resync{$device} = $1;
 			} elsif (/^\s*$/) {
 				$device=undef;
 			}
@@ -84,6 +87,10 @@
 			$msg .= sprintf " %s status=%s, recovery=%s, finish=%s.",
 				$devices{$k}, $status{$k}, $recovery{$k}, $finish{$k};
 			$code = max_state($code, "WARNING");
+		} elsif (defined $resync{$k}) {
+			$msg .= sprintf " %s status=%s,  resync=%s.",
+				$devices{$k}, $status{$k}, $resync{$k};
+			$code = max_state($code, "WARNING");
 		} else {
 			$msg .= sprintf " %s status=%s.", $devices{$k}, $status{$k};
 			$code = max_state($code, "CRITICAL");

Maybe thats what you expecting?

With kind regards, Jan.
-- 
Never write mail to <waja at spamfalle.info>, you have been warned!
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GIT d-- s+: a C+++ UL++++ P+ L+++ E--- W+++ N+++ o++ K++ w--- O M V- PS PE Y++
PGP++ t-- 5 X R tv- b+ DI D+ G++ e++ h---- r+++ y++++ 
------END GEEK CODE BLOCK------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/pkg-nagios-devel/attachments/20100329/7800fef2/attachment.pgp>


More information about the Pkg-nagios-devel mailing list