Refs #5918
This commit is contained in:
parent
0d1e0af937
commit
06a94b6d66
|
@ -121,7 +121,7 @@ sub init {
|
|||
} elsif (defined($self->{dynmode_name}) && $self->{dynmode_name} ne '') {
|
||||
centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $self->{dynmode_name},
|
||||
error_msg => "Cannot load module --dyn-mode.");
|
||||
$self->{mode} = $self->{dynmode_name}->new(options => $self->{options}, output => $self->{output}, mode => $self->{mode_name});
|
||||
$self->{mode} = $self->{dynmode_name}->new(options => $self->{options}, output => $self->{output}, mode => $self->{dynmode_name});
|
||||
} else {
|
||||
$self->{output}->add_option_msg(short_msg => "Need to specify '--mode' or '--dyn-mode' option.");
|
||||
$self->{output}->option_exit();
|
||||
|
|
|
@ -100,7 +100,7 @@ sub init {
|
|||
} elsif (defined($self->{dynmode_name}) && $self->{dynmode_name} ne '') {
|
||||
centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $self->{dynmode_name},
|
||||
error_msg => "Cannot load module --dyn-mode.");
|
||||
$self->{mode} = $self->{dynmode_name}->new(options => $self->{options}, output => $self->{output}, mode => $self->{mode_name});
|
||||
$self->{mode} = $self->{dynmode_name}->new(options => $self->{options}, output => $self->{output}, mode => $self->{dynmode_name});
|
||||
} else {
|
||||
$self->{output}->add_option_msg(short_msg => "Need to specify '--mode' or '--dyn-mode' option.");
|
||||
$self->{output}->option_exit();
|
||||
|
|
|
@ -52,7 +52,7 @@ sub new {
|
|||
|
||||
$self->{options}->add_options(
|
||||
arguments => {
|
||||
'mode:s' => { name => 'mode' },
|
||||
'mode:s' => { name => 'mode_name' },
|
||||
'dyn-mode:s' => { name => 'dynmode_name' },
|
||||
'list-mode' => { name => 'list_mode' },
|
||||
'mode-version:s' => { name => 'mode_version' },
|
||||
|
@ -63,9 +63,10 @@ sub new {
|
|||
$self->{default} = undef;
|
||||
|
||||
$self->{options}->parse_options();
|
||||
$self->{mode_name} = $self->{options}->get_option(argument => 'mode');
|
||||
$self->{list_mode} = $self->{options}->get_option(argument => 'list_mode');
|
||||
$self->{mode_version} = $self->{options}->get_option(argument => 'mode_version');
|
||||
$self->{option_results} = $self->{options}->get_options();
|
||||
foreach (keys %{$self->{option_results}}) {
|
||||
$self->{$_} = $self->{option_results}->{$_};
|
||||
}
|
||||
$self->{options}->clean();
|
||||
|
||||
$self->{options}->add_help(package => $options{package}, sections => 'PLUGIN DESCRIPTION');
|
||||
|
@ -105,7 +106,7 @@ sub init {
|
|||
} elsif (defined($self->{dynmode_name}) && $self->{dynmode_name} ne '') {
|
||||
centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $self->{dynmode_name},
|
||||
error_msg => "Cannot load module --dyn-mode.");
|
||||
$self->{mode} = $self->{dynmode_name}->new(options => $self->{options}, output => $self->{output}, mode => $self->{mode_name});
|
||||
$self->{mode} = $self->{dynmode_name}->new(options => $self->{options}, output => $self->{output}, mode => $self->{dynmode_name});
|
||||
} else {
|
||||
$self->{output}->add_option_msg(short_msg => "Need to specify '--mode' or '--dyn-mode' option.");
|
||||
$self->{output}->option_exit();
|
||||
|
|
|
@ -122,7 +122,7 @@ sub init {
|
|||
} elsif (defined($self->{dynmode_name}) && $self->{dynmode_name} ne '') {
|
||||
centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $self->{dynmode_name},
|
||||
error_msg => "Cannot load module --dyn-mode.");
|
||||
$self->{mode} = $self->{dynmode_name}->new(options => $self->{options}, output => $self->{output}, mode => $self->{mode_name});
|
||||
$self->{mode} = $self->{dynmode_name}->new(options => $self->{options}, output => $self->{output}, mode => $self->{dynmode_name});
|
||||
} else {
|
||||
$self->{output}->add_option_msg(short_msg => "Need to specify '--mode' or '--dyn-mode' option.");
|
||||
$self->{output}->option_exit();
|
||||
|
|
|
@ -105,7 +105,7 @@ sub init {
|
|||
} elsif (defined($self->{dynmode_name}) && $self->{dynmode_name} ne '') {
|
||||
centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $self->{dynmode_name},
|
||||
error_msg => "Cannot load module --dyn-mode.");
|
||||
$self->{mode} = $self->{dynmode_name}->new(options => $self->{options}, output => $self->{output}, mode => $self->{mode_name});
|
||||
$self->{mode} = $self->{dynmode_name}->new(options => $self->{options}, output => $self->{output}, mode => $self->{dynmode_name});
|
||||
} else {
|
||||
$self->{output}->add_option_msg(short_msg => "Need to specify '--mode' or '--dyn-mode' option.");
|
||||
$self->{output}->option_exit();
|
||||
|
|
Loading…
Reference in New Issue