From 6af37d506e9e39bd8873dc1e19ad2a614b095dc3 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 10 Nov 2015 10:44:19 +0100 Subject: [PATCH] + Set sanity mode by default --- centreon-plugins/centreon/plugins/script_custom.pm | 6 ++---- centreon-plugins/centreon/plugins/script_simple.pm | 6 ++---- centreon-plugins/centreon/plugins/script_snmp.pm | 6 ++---- centreon-plugins/centreon/plugins/script_sql.pm | 6 ++---- centreon-plugins/centreon/plugins/script_wsman.pm | 6 ++---- centreon-plugins/docs/en/user/guide.rst | 9 --------- centreon-plugins/docs/fr/user/guide.rst | 9 --------- 7 files changed, 10 insertions(+), 38 deletions(-) diff --git a/centreon-plugins/centreon/plugins/script_custom.pm b/centreon-plugins/centreon/plugins/script_custom.pm index 9a6df7c66..0a42f05ac 100644 --- a/centreon-plugins/centreon/plugins/script_custom.pm +++ b/centreon-plugins/centreon/plugins/script_custom.pm @@ -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'); diff --git a/centreon-plugins/centreon/plugins/script_simple.pm b/centreon-plugins/centreon/plugins/script_simple.pm index fa6543593..ae6d97caa 100644 --- a/centreon-plugins/centreon/plugins/script_simple.pm +++ b/centreon-plugins/centreon/plugins/script_simple.pm @@ -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'); diff --git a/centreon-plugins/centreon/plugins/script_snmp.pm b/centreon-plugins/centreon/plugins/script_snmp.pm index 7c8cfbaaa..17653b9ac 100644 --- a/centreon-plugins/centreon/plugins/script_snmp.pm +++ b/centreon-plugins/centreon/plugins/script_snmp.pm @@ -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'); diff --git a/centreon-plugins/centreon/plugins/script_sql.pm b/centreon-plugins/centreon/plugins/script_sql.pm index 7a21220f0..da585de01 100644 --- a/centreon-plugins/centreon/plugins/script_sql.pm +++ b/centreon-plugins/centreon/plugins/script_sql.pm @@ -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'); diff --git a/centreon-plugins/centreon/plugins/script_wsman.pm b/centreon-plugins/centreon/plugins/script_wsman.pm index d7f38d0c5..0243f4ae7 100644 --- a/centreon-plugins/centreon/plugins/script_wsman.pm +++ b/centreon-plugins/centreon/plugins/script_wsman.pm @@ -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'); diff --git a/centreon-plugins/docs/en/user/guide.rst b/centreon-plugins/docs/en/user/guide.rst index 96191a3e7..60ff97ab4 100644 --- a/centreon-plugins/docs/en/user/guide.rst +++ b/centreon-plugins/docs/en/user/guide.rst @@ -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'." ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/centreon-plugins/docs/fr/user/guide.rst b/centreon-plugins/docs/fr/user/guide.rst index dc1701fb3..df9d7da3b 100644 --- a/centreon-plugins/docs/fr/user/guide.rst +++ b/centreon-plugins/docs/fr/user/guide.rst @@ -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'." ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^