From cab028d8b16e232fb7200fd6d137ebe30ba63f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georg=20Sch=C3=B6nberger?= Date: Mon, 3 Mar 2014 18:47:58 +0100 Subject: [PATCH] Fix physical drive state check --- check_lsi_raid | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_lsi_raid b/check_lsi_raid index 2e78f4b..375e826 100755 --- a/check_lsi_raid +++ b/check_lsi_raid @@ -484,13 +484,13 @@ sub getPhysDeviceStatus { # Check the overall drive state $output_enc = $1; $output_dev = $2; - $flag = 6; + $flag = 5; } elsif($line =~ /^Drive\s\/c$controller\/e([0-9]*)\/s([0-9]*)\sState\s\:/) { # Check the drive state in block Detailed information $output_enc = $1; $output_dev = $2; $flag = 1; - } elsif($flag eq 0 && index($line, " ") eq -1) { + } elsif($flag eq 0 && ($line =~ /^\-{5,}$/ || $line =~ /^\s*$/)) { # Detect the end of the block which was last checked $flag = -1; } elsif($flag eq 0) {