From e24f55442793d346df02f8621a46e8afe2d630a6 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Wed, 7 Nov 2007 10:39:27 +0000 Subject: Return unknown if we cnanot open /proc/mdstat git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@303 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- nagios-check-raid.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'nagios-check-raid.pl') 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 =""; -- cgit v1.2.3