summaryrefslogtreecommitdiff
path: root/nagios-check-raid.pl
diff options
context:
space:
mode:
Diffstat (limited to 'nagios-check-raid.pl')
-rwxr-xr-xnagios-check-raid.pl5
1 files changed, 3 insertions, 2 deletions
diff --git a/nagios-check-raid.pl b/nagios-check-raid.pl
index 94b99ed..504d622 100755
--- a/nagios-check-raid.pl
+++ b/nagios-check-raid.pl
@@ -15,7 +15,8 @@
# ------------------------------------------------------------------------------
# Date Author Reason
# ---- ------ ------
-# 05/10/2004 PETER Palfrader Make it work without that 'use util (vars)'
+# 2007-11-07 Peter Palfrader Return unknown if /proc/mdstat does not exist
+# 05/10/2004 Peter Palfrader Make it work without that 'use util (vars)'
# 14/06/2003 TN Initial Release
# - Format of mdstat assumed to be "2 line" per
# device with [??] on the second line.
@@ -81,7 +82,7 @@ $SIG{'ALRM'} = sub {
alarm($timeout);
# Start checking the file...
-open (FH, $stat);
+open (FH, $stat) or print("UNKNOWN: Cannot open $stat: $!\n"), exit $ERRORS{'UNKNOWN'};
$state = $ERRORS{'OK'};
$msg ="";