summaryrefslogtreecommitdiffstats
path: root/web/attachments/63906-check_linux_raid.patch
diff options
context:
space:
mode:
Diffstat (limited to 'web/attachments/63906-check_linux_raid.patch')
-rw-r--r--web/attachments/63906-check_linux_raid.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/web/attachments/63906-check_linux_raid.patch b/web/attachments/63906-check_linux_raid.patch
new file mode 100644
index 0000000..81fa040
--- /dev/null
+++ b/web/attachments/63906-check_linux_raid.patch
@@ -0,0 +1,26 @@
1Index: check_linux_raid.pl
2===================================================================
3--- check_linux_raid.pl (revision 145)
4+++ check_linux_raid.pl (working copy)
5@@ -26,6 +26,12 @@
6
7 my %ERRORS=('DEPENDENT'=>4,'UNKNOWN'=>3,'OK'=>0,'WARNING'=>1,'CRITICAL'=>2);
8
9+# die with an error if we're not on Linux
10+if ($^O ne 'linux') {
11+ print "This plugin only applicable on Linux.\n";
12+ exit $ERRORS{'UNKNOWN'};
13+}
14+
15 open (MDSTAT, "</proc/mdstat") or die "Failed to open /proc/mdstat";
16 my $found = 0;
17 my $status = "";
18@@ -41,7 +47,7 @@
19 ($finish) = /finish=(.*?min)/;
20 }
21 } else {
22- if (/$ARGV[0]/) {
23+ if (/^$ARGV[0]\s*:/) {
24 $found = 1;
25 if (/active/) {
26 $active = 1;