add no-sanity-options

This commit is contained in:
garnier-quentin 2019-09-19 15:01:10 +02:00
parent 1bdb75b7ba
commit a49150aa46
5 changed files with 63 additions and 41 deletions

View File

@ -39,7 +39,8 @@ sub new {
'custommode:s' => { name => 'custommode_name' },
'list-custommode' => { name => 'list_custommode' },
'multiple' => { name => 'multiple' },
'sanity-options' => { name => 'sanity_options' }, # keep it for 6 month before remove it
'no-sanity-options' => { name => 'no_sanity_options' },
'pass-manager:s' => { name => 'pass_manager' },
}
);
$self->{version} = '1.0';
@ -68,8 +69,10 @@ sub load_custom_mode {
my ($self, %options) = @_;
$self->is_custommode(custommode => $self->{custommode_name});
centreon::plugins::misc::mymodule_load(output => $self->{output}, module => $self->{custom_modes}{$self->{custommode_name}},
error_msg => "Cannot load module --custommode.");
centreon::plugins::misc::mymodule_load(
output => $self->{output}, module => $self->{custom_modes}{$self->{custommode_name}},
error_msg => 'Cannot load module --custommode.'
);
$self->{custommode_current} = $self->{custom_modes}{$self->{custommode_name}}->new(options => $self->{options}, output => $self->{output}, mode => $self->{custommode_name});
}
@ -91,7 +94,7 @@ sub init {
if (defined($self->{list_custommode})) {
$self->list_custommode();
}
$self->{options}->set_sanity();
$self->{options}->set_sanity() if (!defined($self->{no_sanity_options}));
# Output HELP
$self->{options}->add_help(package => 'centreon::plugins::output', sections => 'OUTPUT OPTIONS');
@ -293,6 +296,10 @@ List available custom modes.
Multiple custom mode objects (some mode needs it).
=item B<--pass-manager>
Use a password manager.
=back
=head1 DESCRIPTION

View File

@ -36,7 +36,8 @@ sub new {
'dyn-mode:s' => { name => 'dynmode_name' },
'list-mode' => { name => 'list_mode' },
'mode-version:s' => { name => 'mode_version' },
'sanity-options' => { name => 'sanity_options' }, # keep it for 6 month before remove it
'no-sanity-options' => { name => 'no_sanity_options' },
'pass-manager:s' => { name => 'pass_manager' },
}
);
$self->{version} = '1.0';
@ -72,7 +73,7 @@ sub init {
if (defined($self->{list_mode})) {
$self->list_mode();
}
$self->{options}->set_sanity();
$self->{options}->set_sanity() if (!defined($self->{no_sanity_options}));
# Output HELP
$self->{options}->add_help(package => 'centreon::plugins::output', sections => 'OUTPUT OPTIONS');
@ -219,6 +220,10 @@ Check minimal version of mode. If not, unknown error.
Display plugin version.
=item B<--pass-manager>
Use a password manager.
=back
=head1 DESCRIPTION

View File

@ -38,7 +38,7 @@ sub new {
'dyn-mode:s' => { name => 'dynmode_name' },
'list-mode' => { name => 'list_mode' },
'mode-version:s' => { name => 'mode_version' },
'sanity-options' => { name => 'sanity_options' }, # keep it for 6 month before remove it
'no-sanity-options' => { name => 'no_sanity_options' },
'pass-manager:s' => { name => 'pass_manager' },
}
);
@ -75,7 +75,7 @@ sub init {
if (defined($self->{list_mode})) {
$self->list_mode();
}
$self->{options}->set_sanity();
$self->{options}->set_sanity() if (!defined($self->{no_sanity_options}));
# Output HELP
$self->{options}->add_help(package => 'centreon::plugins::output', sections => 'OUTPUT OPTIONS');

View File

@ -40,7 +40,8 @@ sub new {
'sqlmode:s' => { name => 'sqlmode_name', default => 'dbi' },
'list-sqlmode' => { name => 'list_sqlmode' },
'multiple' => { name => 'multiple' },
'sanity-options' => { name => 'sanity_options' }, # keep it for 6 month before remove it
'no-sanity-options' => { name => 'no_sanity_options' },
'pass-manager:s' => { name => 'pass_manager' },
}
);
$self->{version} = '1.0';
@ -83,7 +84,7 @@ sub init {
if (defined($self->{list_sqlmode})) {
$self->list_sqlmode();
}
$self->{options}->set_sanity();
$self->{options}->set_sanity() if (!defined($self->{no_sanity_options}));
# Output HELP
$self->{options}->add_help(package => 'centreon::plugins::output', sections => 'OUTPUT OPTIONS');
@ -292,6 +293,10 @@ List available sql modes.
Multiple database connections (some mode needs it).
=item B<--pass-manager>
Use a password manager.
=back
=head1 DESCRIPTION

View File

@ -38,7 +38,8 @@ sub new {
'dyn-mode:s' => { name => 'dynmode_name' },
'list-mode' => { name => 'list_mode' },
'mode-version:s' => { name => 'mode_version' },
'sanity-options' => { name => 'sanity_options' }, # keep it for 6 month before remove it
'no-sanity-options' => { name => 'no_sanity_options' },
'pass-manager:s' => { name => 'pass_manager' },
}
);
$self->{version} = '1.0';
@ -74,7 +75,7 @@ sub init {
if (defined($self->{list_mode})) {
$self->list_mode();
}
$self->{options}->set_sanity();
$self->{options}->set_sanity() if (!defined($self->{no_sanity_options}));
# Output HELP
$self->{options}->add_help(package => 'centreon::plugins::output', sections => 'OUTPUT OPTIONS');
@ -223,6 +224,10 @@ Check minimal version of mode. If not, unknown error.
Display plugin version.
=item B<--pass-manager>
Use a password manager.
=back
=head1 DESCRIPTION