mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-24 22:25:02 +02:00
fix: set custom path for ibm ds and dell md
This commit is contained in:
parent
cf6a1b1fef
commit
871d60e2ec
@ -43,8 +43,7 @@ sub new {
|
||||
}
|
||||
|
||||
if (!defined($options{noptions})) {
|
||||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
$options{options}->add_options(arguments => {
|
||||
"smcli-command:s" => { name => 'smcli_command', default => 'SMcli' },
|
||||
"smcli-path:s" => { name => 'smcli_path', },
|
||||
"sudo:s" => { name => 'sudo', },
|
||||
@ -84,6 +83,7 @@ sub set_defaults {
|
||||
# Manage default value
|
||||
foreach (keys %{$options{default}}) {
|
||||
if ($_ eq $self->{mode}) {
|
||||
if (ref($options{default}->{$_}) eq 'ARRAY') {
|
||||
for (my $i = 0; $i < scalar(@{$options{default}->{$_}}); $i++) {
|
||||
foreach my $opt (keys %{$options{default}->{$_}[$i]}) {
|
||||
if (!defined($self->{option_results}->{$opt}[$i])) {
|
||||
@ -92,6 +92,15 @@ sub set_defaults {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ref($options{default}->{$_}) eq 'HASH') {
|
||||
foreach my $opt (keys %{$options{default}->{$_}}) {
|
||||
if (!defined($self->{option_results}->{$opt})) {
|
||||
$self->{option_results}->{$opt} = $options{default}->{$_}->{$opt};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,8 +31,7 @@ sub new {
|
||||
bless $self, $class;
|
||||
|
||||
$self->{version} = '1.0';
|
||||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
$options{options}->add_options(arguments => {
|
||||
"storage-command:s" => { name => 'storage_command', },
|
||||
});
|
||||
|
||||
|
@ -35,9 +35,16 @@ sub new {
|
||||
'health-status' => 'centreon::common::smcli::mode::healthstatus',
|
||||
);
|
||||
$self->{custom_modes}{smcli} = 'centreon::common::smcli::custom::custom';
|
||||
$self->{default} = { 'health-status' => { storage_command => 'show storageArray healthstatus;',
|
||||
smcli_path => '/opt/dell/mdstoragemanager/client' }, };
|
||||
|
||||
$self->{default} = {
|
||||
'health-status' => {
|
||||
storage_command => 'show storageArray healthstatus;',
|
||||
}
|
||||
};
|
||||
$self->{customdefault} = {
|
||||
'smcli' => {
|
||||
smcli_path => '/opt/dell/mdstoragemanager/client',
|
||||
}
|
||||
};
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
@ -35,8 +35,17 @@ sub new {
|
||||
'health-status' => 'centreon::common::smcli::mode::healthstatus',
|
||||
);
|
||||
$self->{custom_modes}{smcli} = 'centreon::common::smcli::custom::custom';
|
||||
$self->{default} = { 'health-status' => { storage_command => 'show storageSubsystem healthstatus;',
|
||||
smcli_path => '/opt/IBM_DS/client' }, };
|
||||
|
||||
$self->{default} = {
|
||||
'health-status' => {
|
||||
storage_command => 'show storageSubsystem healthstatus;',
|
||||
}
|
||||
};
|
||||
$self->{customdefault} = {
|
||||
'smcli' => {
|
||||
smcli_path => '/opt/IBM_DS/client',
|
||||
}
|
||||
};
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
@ -35,8 +35,17 @@ sub new {
|
||||
'health-status' => 'centreon::common::smcli::mode::healthstatus',
|
||||
);
|
||||
$self->{custom_modes}{smcli} = 'centreon::common::smcli::custom::custom';
|
||||
$self->{default} = { 'health-status' => { storage_command => 'show storageSubsystem healthstatus;',
|
||||
smcli_path => '/opt/IBM_DS/client' }, };
|
||||
|
||||
$self->{default} = {
|
||||
'health-status' => {
|
||||
storage_command => 'show storageSubsystem healthstatus;',
|
||||
}
|
||||
};
|
||||
$self->{customdefault} = {
|
||||
'smcli' => {
|
||||
smcli_path => '/opt/IBM_DS/client',
|
||||
}
|
||||
};
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
@ -35,8 +35,17 @@ sub new {
|
||||
'health-status' => 'centreon::common::smcli::mode::healthstatus',
|
||||
);
|
||||
$self->{custom_modes}{smcli} = 'centreon::common::smcli::custom::custom';
|
||||
$self->{default} = { 'health-status' => { storage_command => 'show storageSubsystem healthstatus;',
|
||||
smcli_path => '/opt/IBM_DS/client' }, };
|
||||
|
||||
$self->{default} = {
|
||||
'health-status' => {
|
||||
storage_command => 'show storageSubsystem healthstatus;',
|
||||
}
|
||||
};
|
||||
$self->{customdefault} = {
|
||||
'smcli' => {
|
||||
smcli_path => '/opt/IBM_DS/client',
|
||||
}
|
||||
};
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user