diff options
author | Peter Palfrader <peter@palfrader.org> | 2007-11-07 10:39:27 +0000 |
---|---|---|
committer | weasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede> | 2007-11-07 10:39:27 +0000 |
commit | e24f55442793d346df02f8621a46e8afe2d630a6 (patch) | |
tree | 392227d15e7170a64a734487bc60669bc87fcd9f | |
parent | ab49c20a3826ab058d0fdd6cf39a9628eb6e3e80 (diff) |
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
-rwxr-xr-x | nagios-check-raid.pl | 5 |
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 =""; |