From b51ab9df98438e68c83ce20f896c9a7cb8bc1dcc Mon Sep 17 00:00:00 2001 From: Matthew Kent Date: Mon, 29 Nov 2004 04:49:10 +0000 Subject: Better error checking (820806) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@948 f882894a-f735-0410-b71e-b25c423dba1c --- contrib/check_linux_raid.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/contrib/check_linux_raid.pl b/contrib/check_linux_raid.pl index 25fdf88a..2a58dbe0 100644 --- a/contrib/check_linux_raid.pl +++ b/contrib/check_linux_raid.pl @@ -26,6 +26,12 @@ use strict; my %ERRORS=('DEPENDENT'=>4,'UNKNOWN'=>3,'OK'=>0,'WARNING'=>1,'CRITICAL'=>2); +# die with an error if we're not on Linux +if ($^O ne 'linux') { + print "This plugin only applicable on Linux.\n"; + exit $ERRORS{'UNKNOWN'}; +} + open (MDSTAT, ") { last; } } else { - if (/$ARGV[0]/) { + if (/^$ARGV[0]\s*:/) { $found = 1; if (/active/) { $active = 1; -- cgit v1.2.3-74-g34f1