mirror of
https://github.com/thomas-krenn/check_lsi_raid.git
synced 2026-02-26 13:48:42 +01:00
Fix checking of storcli path
This commit is contained in:
@@ -813,6 +813,27 @@ MAIN: {
|
||||
my $platform = $^O;
|
||||
my $statusMessage = '';
|
||||
|
||||
if ( !(GetOptions(
|
||||
'h|help' => sub {displayHelp();},
|
||||
'v|verbose' => sub {$VERBOSITY = 1 },
|
||||
'vv' => sub {$VERBOSITY = 2},
|
||||
'vvv' => sub {$VERBOSITY = 3},
|
||||
'V|version' => sub {displayVersion($sudo, $storcli);},
|
||||
'C|controller=i' => \$controller,
|
||||
'EID|enclosure=s' => \@enclosures,
|
||||
'LD|logicaldevice=s' => \@logDevices,
|
||||
'PD|physicaldevice=s' => \@physDevices,
|
||||
'Tw|temperature-warn=s' => \@temperature_w,
|
||||
'Tc|temperature-critical=s' => \@temperature_c,
|
||||
'PDTw|physicaldevicetemperature-warn=s' => \@physicalDeviceTemperature_w,
|
||||
'PDTc|physicaldevicetemperature-critical=s' => \@physicalDeviceTemperature_c,
|
||||
'p|path=s' => \$storcli,
|
||||
'b|BBU=i' => \$bbu
|
||||
))) {
|
||||
print $NAME . " Version: " . $VERSION ."\n";
|
||||
displayUsage();
|
||||
exit(STATE_UNKNOWN);
|
||||
}
|
||||
# Check platform
|
||||
if ($platform eq 'linux') {
|
||||
chomp($sudo = `which sudo`);
|
||||
@@ -847,28 +868,6 @@ MAIN: {
|
||||
}
|
||||
}
|
||||
|
||||
if ( !(GetOptions(
|
||||
'h|help' => sub {displayHelp();},
|
||||
'v|verbose' => sub {$VERBOSITY = 1 },
|
||||
'vv' => sub {$VERBOSITY = 2},
|
||||
'vvv' => sub {$VERBOSITY = 3},
|
||||
'V|version' => sub {displayVersion($sudo, $storcli);},
|
||||
'C|controller=i' => \$controller,
|
||||
'EID|enclosure=s' => \@enclosures,
|
||||
'LD|logicaldevice=s' => \@logDevices,
|
||||
'PD|physicaldevice=s' => \@physDevices,
|
||||
'Tw|temperature-warn=s' => \@temperature_w,
|
||||
'Tc|temperature-critical=s' => \@temperature_c,
|
||||
'PDTw|physicaldevicetemperature-warn=s' => \@physicalDeviceTemperature_w,
|
||||
'PDTc|physicaldevicetemperature-critical=s' => \@physicalDeviceTemperature_c,
|
||||
'p|path=s' => \$storcli,
|
||||
'b|BBU=i' => \$bbu
|
||||
))) {
|
||||
print $NAME . " Version: " . $VERSION ."\n";
|
||||
displayUsage();
|
||||
exit(STATE_UNKNOWN);
|
||||
}
|
||||
|
||||
# Input validation
|
||||
my @controllerVersion = `$sudo $storcli /c$controller show all`;
|
||||
if($controllerVersion[2] eq "Description = Controller $controller not found\n") {
|
||||
|
||||
Reference in New Issue
Block a user