Page MenuHomePhabricator
Paste P8427

patch.diff
ActivePublic

Authored by jbond on Apr 23 2019, 9:47 AM.
Tags
None
Referenced Files
F28742044: raw.txt
Apr 23 2019, 9:47 AM
Subscribers
None
--- dsa-check-hpssacli 2019-04-23 10:46:51.798939300 +0100
+++ dsa-check-ssacli 2019-04-23 10:46:35.434910938 +0100
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
# check _physical_ disk status of disks on HP smart array controllers
-# requires hpssacli
+# requires ssacli
#
# does _not_ check raid status. use arrayprobe for that.
@@ -47,7 +47,7 @@
sub runcmd($) {
my ($cmd) = @_;
- $cmd = "sudo hpssacli $cmd";
+ $cmd = "sudo ssacli $cmd";
open(FH, $cmd."|") or die ("Cannot run $cmd: $!");
my @lines = <FH>;
close FH;
@@ -92,15 +92,15 @@
push @controllers, $1;
next;
};
- die ("Cannot read line '$_' gotten from hpssacli controller all show\n");
+ die ("Cannot read line '$_' gotten from ssacli controller all show\n");
};
if (scalar @controllers == 0) {
if ($params->{'no-controller-ok'}) {
- print "No smartarray controllers found with hpssacli\n";
+ print "No smartarray controllers found with ssacli\n";
exit $CODE{'OK'}
} else {
- print "UNKNOWN: No smartarray controllers found with hpssacli\n";
+ print "UNKNOWN: No smartarray controllers found with ssacli\n";
exit $CODE{'UNKNOWN'}
}
};
@@ -119,14 +119,14 @@
chomp;
next if /^$/;
next if (/^\S.*in Slot $slot/);
- next if /^ *array [A-Z]$/;
+ next if /^ *Array [A-Z]$/;
if (/logicaldrive ([0-9a-z]+)/) {
push @logicaldrives, $1;
next;
} elsif (/^Error: The specified device does not have any logical drives.$/) {
$nodrives = 1;
} else {
- die ("Cannot read line '$_' gotten from hpssacli controller slot = $slot logicaldrive all show\n");
+ die ("Cannot read line '$_' gotten from ssacli controller slot = $slot logicaldrive all show\n");
}
};
@@ -178,7 +178,7 @@
chomp;
next if /^$/;
next if (/^\S.*in Slot $slot/);
- next if /^ *array [A-Z]$/;
+ next if /^ *Array [A-Z]$/;
next if /^ *unassigned/;
if (/^ *HBA Drives/) {
# HBA mode implies to logical drives, thus reset the "drives found" check and proceed with
@@ -186,7 +186,7 @@
$nodrives = 0;
next;
}
- if (/^ *(array [A-Z]) \(Failed\)$/) {
+ if (/^ *(Array [A-Z]) \(Failed\)$/) {
record('CRITICAL');
push @{$status{'Failed'}}, $1;
} elsif (/^Error: The specified controller does not have any physical drives on it.$/) {
@@ -206,7 +206,7 @@
};
push @drives, $drive;
} else {
- die ("Cannot read line '$_' gotten from hpssacli controller slot=$slot pd all show\n");
+ die ("Cannot read line '$_' gotten from ssacli controller slot=$slot pd all show\n");
};
};