mirror of
https://github.com/thomas-krenn/check_lsi_raid.git
synced 2026-03-01 15:18:40 +01:00
Fix ld name
This commit is contained in:
@@ -383,7 +383,7 @@ sub getLogicalDeviceStatus {
|
||||
my $currBlock;
|
||||
foreach my $line(@output){
|
||||
my @splittedLine;
|
||||
if($line =~ /^\/c[0-9]*\/v([0-9]*.*)/){
|
||||
if($line =~ /^\/(c[0-9]*\/v[0-9]*).*/){
|
||||
$currBlock = $1;
|
||||
next;
|
||||
}
|
||||
@@ -392,7 +392,6 @@ sub getLogicalDeviceStatus {
|
||||
@splittedLine = map { s/^\s*//; s/\s*$//; $_; } split(/\s+/,$line);
|
||||
my %lineValues_h;
|
||||
# The current block is the c0/v0 name
|
||||
$currBlock =~ /\w+/;
|
||||
$lineValues_h{'ld'} = $currBlock;
|
||||
for(my $i = 0; $i < @ldmap_a; $i++){
|
||||
$lineValues_h{$ldmap_a[$i]} = $splittedLine[$i];
|
||||
@@ -936,16 +935,16 @@ MAIN: {
|
||||
}
|
||||
}
|
||||
# Prepare storcli command
|
||||
$storcli .= "/c$controller";
|
||||
$storcli .= " /c$controller";
|
||||
|
||||
|
||||
# Input validation
|
||||
#FIXME Replace with storcli show ctrlcount
|
||||
my @controllerVersion = `$sudo $storcli /c$controller show all`;
|
||||
if($controllerVersion[2] eq "Description = Controller $controller not found\n") {
|
||||
print "Invalid controller number, device not found!\n";
|
||||
exit(STATE_UNKNOWN);
|
||||
}
|
||||
# my @controllerVersion = `$storcli /c$controller show all`;
|
||||
# if($controllerVersion[2] eq "Description = Controller $controller not found\n") {
|
||||
# print "Invalid controller number, device not found!\n";
|
||||
# exit(STATE_UNKNOWN);
|
||||
# }
|
||||
if(($bbu != 1) && ($bbu != 0)) {
|
||||
print "Invalid BBU/CV parameter, must be 0 or 1!\n";
|
||||
exit(STATE_UNKNOWN);
|
||||
@@ -974,31 +973,31 @@ MAIN: {
|
||||
my $exitstatus = 0;
|
||||
my $newexitstatus = 0;
|
||||
my $newstatusMessage = '';
|
||||
($newexitstatus, $statusMessage) = getControllerStatus($sudo, $storcli, $controller, \@temperature_w, \@temperature_c);
|
||||
$newstatusMessage .= $statusMessage;
|
||||
# ($newexitstatus, $statusMessage) = getControllerStatus($sudo, $storcli, $controller, \@temperature_w, \@temperature_c);
|
||||
# $newstatusMessage .= $statusMessage;
|
||||
# $exitstatus = getExitState($newexitstatus, $exitstatus);
|
||||
# my ($bbuPresent,$cvPresent) = (0,0);
|
||||
# if($bbu == 1){
|
||||
# ($bbuPresent,$cvPresent) = checkBBUorCVIsPresent($sudo, $storcli, $controller);
|
||||
# if($bbuPresent == 0 && $cvPresent == 0){
|
||||
# $exitstatus = getExitState(STATE_CRITICAL, $exitstatus);
|
||||
# $newstatusMessage .= "No BBU or CV found, ";
|
||||
# }
|
||||
# }
|
||||
# if($bbuPresent == 1){
|
||||
# ($newexitstatus, $statusMessage) = getBBUStatus($sudo, $storcli, $controller);
|
||||
# $newstatusMessage .= $statusMessage;
|
||||
# $exitstatus = getExitState($newexitstatus, $exitstatus);
|
||||
# }
|
||||
# if($cvPresent == 1){
|
||||
# ($newexitstatus, $statusMessage) = getCVStatus($sudo, $storcli, $controller);
|
||||
# $newstatusMessage .= $statusMessage;
|
||||
# $exitstatus = getExitState($newexitstatus, $exitstatus);
|
||||
# }
|
||||
# ($newexitstatus, $statusMessage) = getLogicalDeviceStatus($sudo, $storcli, $controller, \@logDevices, "init");
|
||||
# $newstatusMessage .= $statusMessage;
|
||||
$exitstatus = getExitState($newexitstatus, $exitstatus);
|
||||
my ($bbuPresent,$cvPresent) = (0,0);
|
||||
if($bbu == 1){
|
||||
($bbuPresent,$cvPresent) = checkBBUorCVIsPresent($sudo, $storcli, $controller);
|
||||
if($bbuPresent == 0 && $cvPresent == 0){
|
||||
$exitstatus = getExitState(STATE_CRITICAL, $exitstatus);
|
||||
$newstatusMessage .= "No BBU or CV found, ";
|
||||
}
|
||||
}
|
||||
if($bbuPresent == 1){
|
||||
($newexitstatus, $statusMessage) = getBBUStatus($sudo, $storcli, $controller);
|
||||
$newstatusMessage .= $statusMessage;
|
||||
$exitstatus = getExitState($newexitstatus, $exitstatus);
|
||||
}
|
||||
if($cvPresent == 1){
|
||||
($newexitstatus, $statusMessage) = getCVStatus($sudo, $storcli, $controller);
|
||||
$newstatusMessage .= $statusMessage;
|
||||
$exitstatus = getExitState($newexitstatus, $exitstatus);
|
||||
}
|
||||
($newexitstatus, $statusMessage) = getLogicalDeviceStatus($sudo, $storcli, $controller, \@logDevices, "init");
|
||||
$newstatusMessage .= $statusMessage;
|
||||
$exitstatus = getExitState($newexitstatus, $exitstatus);
|
||||
($newexitstatus, $statusMessage) = getLogicalDeviceStatus($sudo, $storcli, $controller, \@logDevices, "all");
|
||||
($newexitstatus, $statusMessage) = getLogicalDeviceStatus($storcli, \@logDevices, "all");
|
||||
$newstatusMessage .= $statusMessage;
|
||||
$exitstatus = getExitState($newexitstatus, $exitstatus);
|
||||
($newexitstatus, $statusMessage) = getPhysDeviceStatus($sudo, $storcli, $controller, \@enclosures, \@physDevices, \@physicalDeviceTemperature_w, \@physicalDeviceTemperature_c, "initialization");
|
||||
|
||||
Reference in New Issue
Block a user