+ Set sanity mode by default

This commit is contained in:
garnier-quentin 2015-11-10 10:44:19 +01:00
parent 702ebf4723
commit fca3e08804
7 changed files with 10 additions and 38 deletions

View File

@ -42,7 +42,7 @@ sub new {
'custommode:s' => { name => 'custommode_name' },
'list-custommode' => { name => 'list_custommode' },
'multiple' => { name => 'multiple' },
'sanity-options' => { name => 'sanity_options' },
'sanity-options' => { name => 'sanity_options' }, # keep it for 6 month before remove it
}
);
$self->{version} = '1.0';
@ -93,9 +93,7 @@ sub init {
if (defined($self->{list_custommode})) {
$self->list_custommode();
}
if (defined($self->{sanity_options})) {
$self->{options}->set_sanity();
}
$self->{options}->set_sanity();
# Output HELP
$self->{options}->add_help(package => 'centreon::plugins::output', sections => 'OUTPUT OPTIONS');

View File

@ -39,7 +39,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' },
'sanity-options' => { name => 'sanity_options' }, # keep it for 6 month before remove it
}
);
$self->{version} = '1.0';
@ -74,9 +74,7 @@ sub init {
if (defined($self->{list_mode})) {
$self->list_mode();
}
if (defined($self->{sanity_options})) {
$self->{options}->set_sanity();
}
$self->{options}->set_sanity();
# Output HELP
$self->{options}->add_help(package => 'centreon::plugins::output', sections => 'OUTPUT OPTIONS');

View File

@ -41,7 +41,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' },
'sanity-options' => { name => 'sanity_options' }, # keep it for 6 month before remove it
}
);
$self->{version} = '1.0';
@ -76,9 +76,7 @@ sub init {
if (defined($self->{list_mode})) {
$self->list_mode();
}
if (defined($self->{sanity_options})) {
$self->{options}->set_sanity();
}
$self->{options}->set_sanity();
# Output HELP
$self->{options}->add_help(package => 'centreon::plugins::output', sections => 'OUTPUT OPTIONS');

View File

@ -43,7 +43,7 @@ sub new {
'sqlmode:s' => { name => 'sqlmode_name', default => 'dbi' },
'list-sqlmode' => { name => 'list_sqlmode' },
'multiple' => { name => 'multiple' },
'sanity-options' => { name => 'sanity_options' },
'sanity-options' => { name => 'sanity_options' }, # keep it for 6 month before remove it
}
);
$self->{version} = '1.0';
@ -85,9 +85,7 @@ sub init {
if (defined($self->{list_sqlmode})) {
$self->list_sqlmode();
}
if (defined($self->{sanity_options})) {
$self->{options}->set_sanity();
}
$self->{options}->set_sanity();
# Output HELP
$self->{options}->add_help(package => 'centreon::plugins::output', sections => 'OUTPUT OPTIONS');

View File

@ -41,7 +41,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' },
'sanity-options' => { name => 'sanity_options' }, # keep it for 6 month before remove it
}
);
$self->{version} = '1.0';
@ -76,9 +76,7 @@ sub init {
if (defined($self->{list_mode})) {
$self->list_mode();
}
if (defined($self->{sanity_options})) {
$self->{options}->set_sanity();
}
$self->{options}->set_sanity();
# Output HELP
$self->{options}->add_help(package => 'centreon::plugins::output', sections => 'OUTPUT OPTIONS');

View File

@ -557,15 +557,6 @@ The mapping between 'snmpwalk' options and "centreon-plugins" options:
Miscellaneous
-------------
I use an option but it doesn't seem to work
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Before opening a ticket on the github, please use the option ``--sanity-options``. It checks if you have misspell an option:
::
$ perl centreon_plugins.pl --plugin=os::linux::snmp::plugin --mode=traffic --hostname=127.0.0.1 --snmp-version=2c --snmp-community=public --interface='.*' --name --regex --verbose --skip --skip-speed0 --sanity-options
Unknown option: regex
I get the error: "UNKNOWN: Need to specify '--custommode'."
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -557,15 +557,6 @@ L'association entre les options 'snmpwalk' et les options "centreon-plugins" :
Divers
------
J'utilise une options mais il semblerait qu'elle ne fonctionne pas
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Avant d'ouvrir un ticket sur github, utilisez l'option ``--sanity-options``. Cela vérifie si vous avez mal orthographié une option :
::
$ perl centreon_plugins.pl --plugin=os::linux::snmp::plugin --mode=traffic --hostname=127.0.0.1 --snmp-version=2c --snmp-community=public --interface='.*' --name --regex --verbose --skip --skip-speed0 --sanity-options
Unknown option: regex
J'ai l'erreur: "UNKNOWN: Need to specify '--custommode'."
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^