diff --git a/centreon-plugins/storage/emc/xtremio/restapi/mode/clusterhealth.pm b/centreon-plugins/storage/emc/xtremio/restapi/mode/clusterhealth.pm index a626c9520..c9bceb96a 100644 --- a/centreon-plugins/storage/emc/xtremio/restapi/mode/clusterhealth.pm +++ b/centreon-plugins/storage/emc/xtremio/restapi/mode/clusterhealth.pm @@ -108,8 +108,6 @@ sub check_options { $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status, instance => $instance }; } - - } sub run { @@ -149,7 +147,6 @@ sub run { $self->{output}->display(); $self->{output}->exit(); - } sub check_filter { diff --git a/centreon-plugins/storage/emc/xtremio/restapi/mode/ssdendurance.pm b/centreon-plugins/storage/emc/xtremio/restapi/mode/ssdendurance.pm index d1ae7499a..1e1680a28 100644 --- a/centreon-plugins/storage/emc/xtremio/restapi/mode/ssdendurance.pm +++ b/centreon-plugins/storage/emc/xtremio/restapi/mode/ssdendurance.pm @@ -33,9 +33,9 @@ sub new { $self->{version} = '1.1'; $options{options}->add_options(arguments => { - "filter:s@" => { name => 'filter' }, - "warning:s" => { name => 'warning' }, - "critical:s" => { name => 'critical' }, + "filter:s@" => { name => 'filter' }, + "warning:s" => { name => 'warning' }, + "critical:s" => { name => 'critical' }, }); return $self; @@ -53,14 +53,13 @@ sub check_options { } if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); - $self->{output}->option_exit(); + $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); + $self->{output}->option_exit(); } if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); - $self->{output}->option_exit(); + $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); + $self->{output}->option_exit(); } - } sub run { @@ -85,21 +84,18 @@ sub run { my $exit = $self->{perfdata}->threshold_check(value => $details->{'percent-endurance-remaining'}, - threshold => [ { label => 'warning', 'exit_litteral' => 'warning' }, { label => 'critical', exit_litteral => 'critical' } ]); - - $self->{output}->perfdata_add(label => $item."_endurance", - value => $details->{'percent-endurance-remaining'}, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), - min => 0, max => 100); - - if ($exit ne 'ok') { + threshold => [ { label => 'warning', exit_litteral => 'warning' }, { label => 'critical', exit_litteral => 'critical' } ]); + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit, short_msg => sprintf("SSD '%s' endurance is %i%%", $item, $details->{'percent-endurance-remaining'})); } - - } + $self->{output}->perfdata_add(label => $item . "_endurance", unit => '%', + value => $details->{'percent-endurance-remaining'}, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), + min => 0, max => 100); + } $self->{output}->display(); $self->{output}->exit(); diff --git a/centreon-plugins/storage/emc/xtremio/restapi/mode/ssdiops.pm b/centreon-plugins/storage/emc/xtremio/restapi/mode/ssdiops.pm index 5faaf70b8..c019be0bc 100644 --- a/centreon-plugins/storage/emc/xtremio/restapi/mode/ssdiops.pm +++ b/centreon-plugins/storage/emc/xtremio/restapi/mode/ssdiops.pm @@ -57,33 +57,30 @@ sub check_options { } if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); - $self->{output}->option_exit(); + $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); + $self->{output}->option_exit(); } if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); - $self->{output}->option_exit(); + $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); + $self->{output}->option_exit(); } - if (($self->{perfdata}->threshold_validate(label => 'warning-read', value => $self->{option_results}->{warning_read})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning-read threshold '" . $self->{option_results}->{warning_read} . "'."); - $self->{output}->option_exit(); + $self->{output}->add_option_msg(short_msg => "Wrong warning-read threshold '" . $self->{option_results}->{warning_read} . "'."); + $self->{output}->option_exit(); } if (($self->{perfdata}->threshold_validate(label => 'critical-read', value => $self->{option_results}->{critical_read})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical-read threshold '" . $self->{option_results}->{critical_read} . "'."); - $self->{output}->option_exit(); + $self->{output}->add_option_msg(short_msg => "Wrong critical-read threshold '" . $self->{option_results}->{critical_read} . "'."); + $self->{output}->option_exit(); } if (($self->{perfdata}->threshold_validate(label => 'warning-write', value => $self->{option_results}->{warning_write})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong warning-write threshold '" . $self->{option_results}->{warning_write} . "'."); - $self->{output}->option_exit(); + $self->{output}->add_option_msg(short_msg => "Wrong warning-write threshold '" . $self->{option_results}->{warning_write} . "'."); + $self->{output}->option_exit(); } if (($self->{perfdata}->threshold_validate(label => 'critical-write', value => $self->{option_results}->{critical_write})) == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong critical-write threshold '" . $self->{option_results}->{critical_write} . "'."); - $self->{output}->option_exit(); + $self->{output}->add_option_msg(short_msg => "Wrong critical-write threshold '" . $self->{option_results}->{critical_write} . "'."); + $self->{output}->option_exit(); } - - } sub run { diff --git a/centreon-plugins/storage/emc/xtremio/restapi/mode/xenvscpu.pm b/centreon-plugins/storage/emc/xtremio/restapi/mode/xenvscpu.pm index 3c8454ad4..2ead76f0d 100644 --- a/centreon-plugins/storage/emc/xtremio/restapi/mode/xenvscpu.pm +++ b/centreon-plugins/storage/emc/xtremio/restapi/mode/xenvscpu.pm @@ -60,7 +60,6 @@ sub check_options { $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); $self->{output}->option_exit(); } - } sub run { @@ -86,20 +85,17 @@ sub run { my $exit = $self->{perfdata}->threshold_check(value => $details->{'cpu-usage'}, threshold => [ { label => 'warning', 'exit_litteral' => 'warning' }, { label => 'critical', exit_litteral => 'critical' } ]); - - $self->{output}->perfdata_add(label => 'cpu_'.$item, - value => $details->{'cpu-usage'}, - warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), - critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), - min => 0, max => 100); - - if ($exit ne 'ok') { + if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add(severity => $exit, short_msg => sprintf("Xenvs '%s' cpu-Usage is %i%%", $item, $details->{'cpu-usage'})); } - + $self->{output}->perfdata_add(label => 'cpu_' . $item, unit => '%', + value => $details->{'cpu-usage'}, + warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), + critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), + min => 0, max => 100); } $self->{output}->display(); diff --git a/centreon-plugins/storage/emc/xtremio/restapi/mode/xenvsstate.pm b/centreon-plugins/storage/emc/xtremio/restapi/mode/xenvsstate.pm index 9942f4650..2e9a959d4 100644 --- a/centreon-plugins/storage/emc/xtremio/restapi/mode/xenvsstate.pm +++ b/centreon-plugins/storage/emc/xtremio/restapi/mode/xenvsstate.pm @@ -84,7 +84,6 @@ sub check_options { $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status, instance => $instance }; } - } sub run { @@ -119,7 +118,6 @@ sub run { $self->{output}->display(); $self->{output}->exit(); - } sub check_filter {