mirror of
https://github.com/thomas-krenn/check_lsi_raid.git
synced 2026-03-01 15:18:40 +01:00
Replace old status checking lines
This commit is contained in:
@@ -130,11 +130,9 @@ sub checkCommandStatus{
|
||||
foreach my $line (@output){
|
||||
if($line =~ /^Status/){
|
||||
if($line eq "Status = Success\n"){
|
||||
print "true";
|
||||
return 1;
|
||||
}
|
||||
else{
|
||||
print "false";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -375,7 +373,7 @@ sub getLogicalDeviceStatus {
|
||||
$command .= " show $action";
|
||||
my @output = `$command`;
|
||||
|
||||
if($output[1] eq "Status = Success\n") {
|
||||
if(checkCommandStatus(\@output) {
|
||||
if($action eq "all") {
|
||||
my $output_dev = -1;
|
||||
my $flag = -1;
|
||||
@@ -474,7 +472,7 @@ sub getPhysDeviceStatus {
|
||||
$command .= " show $action";
|
||||
my @output = `$command`;
|
||||
|
||||
if($output[1] eq "Status = Success\n") {
|
||||
if(checkCommandStatus(\@output) {
|
||||
if($action eq "all") {
|
||||
my $output_enc = -1;
|
||||
my $output_dev = -1;
|
||||
@@ -668,7 +666,7 @@ sub getBBUStatus {
|
||||
|
||||
my @output = `$command`;
|
||||
|
||||
if($output[1] eq "Status = Success\n") {
|
||||
if(checkCommandStatus(\@output) {
|
||||
my $blockid = 0;
|
||||
foreach my $line (@output) {
|
||||
my $first;
|
||||
@@ -791,7 +789,7 @@ sub getCVStatus {
|
||||
my $statusMessage = '';
|
||||
|
||||
my @output = `$command`;
|
||||
if($output[1] eq "Status = Success\n") {
|
||||
if(checkCommandStatus(\@output) {
|
||||
my $currBlock;
|
||||
foreach my $line (@output) {
|
||||
if($line =~ /^(Cachevault_Info|Firmware_Status)/){
|
||||
@@ -836,13 +834,13 @@ sub checkBBUorCVIsPresent{
|
||||
my ($bbu,$cv);
|
||||
my $command = "$sudo $storcli /c$controller/bbu show";
|
||||
my @output = `$command`;
|
||||
if($output[1] eq "Status = Success\n") {
|
||||
if(checkCommandStatus(\@output) {
|
||||
$bbu = 1;
|
||||
}
|
||||
else{$bbu = 0};
|
||||
$command = "$sudo $storcli /c$controller/cv show";
|
||||
@output = `$command`;
|
||||
if($output[1] eq "Status = Success\n") {
|
||||
if(checkCommandStatus(\@output) {
|
||||
$cv = 1;
|
||||
}
|
||||
else{$cv = 0};
|
||||
|
||||
Reference in New Issue
Block a user