[Nagiosplug-devel] [ nagiosplug-Patches-1338298 ] check_linux_raid plugin does not recognize recovery
SourceForge.net
noreply at sourceforge.net
Tue May 10 23:50:11 CEST 2011
Patches item #1338298, was opened at 2005-10-26 10:09
Message generated for change (Comment added) made by bigpresh
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1338298&group_id=29880
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Bugfix
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Bastiaan Bakker (bastiaan)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_linux_raid plugin does not recognize recovery
Initial Comment:
The check_linux_raid plugin does not properly parse
/proc/mdstat, causing it to report CRITICAL status for
RAID devices that are already recovering. For example
it reports CRITICAL for the following /proc/mdstat
(taken from a CentOS 3.5 box):
Personalities : [raid1]
read_ahead 1024 sectors
Event: 8
md0 : active raid1 sdb1[2] sda1[1]
2097024 blocks [2/1] [_U]
[>....................] recovery = 0.4%
(10168/2097024) finish=23.8min speed=1452K/sec
unused devices: <none>
The attached patch fixes two bugs which cause this problem:
1) do not stop parsing after [_U] but until the next
mdX entry begins, so we won't miss the 'recovery line'
2) allow two or more spaces after 'recovery =' in
order to recognize single digit percentages
Other modifications:
1) Addition of 'speed=' to the output:
WARNING md0 status=[_U], recovery=0.4%, finish=23.8min,
speed=1452K/sec
2) Addition of optionally specification of mdstat file
as second command line parameter. Primarily useful for
debugging.
----------------------------------------------------------------------
Comment By: David Precious (bigpresh)
Date: 2011-05-10 21:50
Message:
I don't seem to be able to add a file to this bug report, for some reason,
but the basic change to fix the main bug is incredibly trivial - I've
created a diff which is at
http://www.preshweb.co.uk/downloads/check_linux_raid.diff - I hope that may
be of help.
If it's easier, I'd be happy to open a new issue for the fact that the
diff addresses - the fact that the recovery line may contain more than one
space after the equals sign, and add the patch there.
----------------------------------------------------------------------
Comment By: Jan Wagner (cyco_dd)
Date: 2011-05-10 19:39
Message:
Maybe cause there is a unified patch missing?
----------------------------------------------------------------------
Comment By: David Precious (bigpresh)
Date: 2011-05-10 13:51
Message:
Seemingly, this bug is still present, over five years after someone took
the time to provide a patch to fix it? Seriously?
----------------------------------------------------------------------
Comment By: Marek Grzybowski (wolodyj)
Date: 2007-08-29 11:34
Message:
Logged In: YES
user_id=1878403
Originator: NO
why in nagios-plugins-1.4.9.tar.gz check_linux_raid still have this bug
?
u can use my patch, it is simply one line, but i prefer bastiaan plugin:
tombo at mg:/tmp/nagios-plugins-1.4.9/contrib$ diff -u
check_linux_raid.pl.orginal check_linux_raid.pl
--- check_linux_raid.pl.orginal 2007-08-29 13:10:36.000000000 +0200
+++ check_linux_raid.pl 2007-08-29 13:10:51.000000000 +0200
@@ -64,6 +64,7 @@
} elsif (/recovery = (.*?)\s/) {
$recovery{$device} = $1;
($finish{$device}) = /finish=(.*?min)/;
+ $device=undef;
} elsif (/^\s*$/) {
$device=undef;
}
----------------------------------------------------------------------
Comment By: Bastiaan Bakker (bastiaan)
Date: 2005-10-31 13:54
Message:
Logged In: YES
user_id=8050
replaced diff with new version:
* fixes output so that nrpe understands it.
* implements --help and --version command line params.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1338298&group_id=29880
More information about the Devel
mailing list