From 46232d0caa4fffbf3c855d6725bc7910757a27d0 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 29 Mar 2019 11:30:36 +0100 Subject: [PATCH] Bug isis avid and storwize --- .../storage/avid/isis/snmp/mode/status.pm | 13 ++++--- .../ibm/storwize/ssh/mode/poolusage.pm | 34 +++++++++---------- 2 files changed, 22 insertions(+), 25 deletions(-) diff --git a/centreon-plugins/storage/avid/isis/snmp/mode/status.pm b/centreon-plugins/storage/avid/isis/snmp/mode/status.pm index 813df3061..726712463 100644 --- a/centreon-plugins/storage/avid/isis/snmp/mode/status.pm +++ b/centreon-plugins/storage/avid/isis/snmp/mode/status.pm @@ -74,11 +74,11 @@ sub new { bless $self, $class; $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "warning-status:s" => { name => 'warning_status', default => '' }, - "critical-status:s" => { name => 'critical_status', default => '%{status} !~ /Online/i' }, - }); + $options{options}->add_options(arguments => { + "warning-status:s" => { name => 'warning_status', default => '' }, + "critical-status:s" => { name => 'critical_status', default => '%{status} !~ /Online/i' }, + }); + return $self; } @@ -86,8 +86,7 @@ sub check_options { my ($self, %options) = @_; $self->SUPER::check_options(%options); - $instance_mode = $self; - $self->change_macros('warning_status', 'critical_status'); + $self->change_macros(macros => ['warning_status', 'critical_status']); } my %map_status = ( diff --git a/centreon-plugins/storage/ibm/storwize/ssh/mode/poolusage.pm b/centreon-plugins/storage/ibm/storwize/ssh/mode/poolusage.pm index c3a6a1040..9244b8003 100644 --- a/centreon-plugins/storage/ibm/storwize/ssh/mode/poolusage.pm +++ b/centreon-plugins/storage/ibm/storwize/ssh/mode/poolusage.pm @@ -138,23 +138,22 @@ sub new { bless $self, $class; $self->{version} = '1.0'; - $options{options}->add_options(arguments => - { - "filter-name:s" => { name => 'filter_name' }, - "warning-status:s" => { name => 'warning_status', default => '%{status} =~ /degraded/i' }, - "critical-status:s" => { name => 'critical_status', default => '%{status} =~ /offline/i' }, - "units:s" => { name => 'units', default => '%' }, - "free" => { name => 'free' }, - "hostname:s" => { name => 'hostname' }, - "ssh-option:s@" => { name => 'ssh_option' }, - "ssh-path:s" => { name => 'ssh_path' }, - "ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, - "timeout:s" => { name => 'timeout', default => 30 }, - "sudo" => { name => 'sudo' }, - "command:s" => { name => 'command' }, - "command-path:s" => { name => 'command_path' }, - "command-options:s" => { name => 'command_options' }, - }); + $options{options}->add_options(arguments => { + "filter-name:s" => { name => 'filter_name' }, + "warning-status:s" => { name => 'warning_status', default => '%{status} =~ /degraded/i' }, + "critical-status:s" => { name => 'critical_status', default => '%{status} =~ /offline/i' }, + "units:s" => { name => 'units', default => '%' }, + "free" => { name => 'free' }, + "hostname:s" => { name => 'hostname' }, + "ssh-option:s@" => { name => 'ssh_option' }, + "ssh-path:s" => { name => 'ssh_path' }, + "ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, + "timeout:s" => { name => 'timeout', default => 30 }, + "sudo" => { name => 'sudo' }, + "command:s" => { name => 'command' }, + "command-path:s" => { name => 'command_path' }, + "command-options:s" => { name => 'command_options' }, + }); return $self; } @@ -166,7 +165,6 @@ sub check_options { if (defined($self->{option_results}->{hostname}) && $self->{option_results}->{hostname} ne '') { $self->{option_results}->{remote} = 1; } - $instance_mode = $self; $self->change_macros(macros => ['warning_status', 'critical_status']); }