diff options
| author | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-09-30 00:03:24 +0200 | 
|---|---|---|
| committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-09-30 00:03:24 +0200 | 
| commit | 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 (patch) | |
| tree | 1c2b6b21704a294940f87c7892676998d8371707 /web/attachments/63906-check_linux_raid.patch | |
| download | site-0b6423f9c99d9edf8c96fefd0f6c453859395aa1.tar.gz | |
Import Nagios Plugins site
Import the Nagios Plugins web site, Cronjobs, infrastructure scripts,
and configuration files.
Diffstat (limited to 'web/attachments/63906-check_linux_raid.patch')
| -rw-r--r-- | web/attachments/63906-check_linux_raid.patch | 26 | 
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 @@ | |||
| 1 | Index: 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; | ||
