From 52db696583e09ea6846df9a5007ba4ee5b32b216 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 12 Sep 2019 18:03:41 +0200 Subject: [PATCH] enhance indent --- .../quadstor/local/mode/vtltapeusage.pm | 52 ++++++++++--------- .../cloud/aws/apigateway/mode/latency.pm | 4 +- .../cloud/aws/apigateway/mode/requests.pm | 4 +- .../cloud/aws/kinesis/mode/recordsstats.pm | 6 +-- .../cloud/aws/kinesis/mode/streams.pm | 6 +-- .../emc/celerra/local/mode/getreason.pm | 25 +++++---- .../storage/emc/celerra/local/plugin.pm | 4 +- .../storage/emc/clariion/plugin.pm | 27 ++++------ .../emc/isilon/snmp/mode/clusterusage.pm | 15 +++--- .../storage/emc/isilon/snmp/mode/hardware.pm | 4 +- .../storage/emc/isilon/snmp/plugin.pm | 6 +-- .../emc/vplex/restapi/mode/storagevolumes.pm | 21 ++++---- .../storage/emc/vplex/restapi/plugin.pm | 16 +++--- 13 files changed, 92 insertions(+), 98 deletions(-) diff --git a/centreon-plugins/apps/backup/quadstor/local/mode/vtltapeusage.pm b/centreon-plugins/apps/backup/quadstor/local/mode/vtltapeusage.pm index 5178a4398..5b785b0ee 100644 --- a/centreon-plugins/apps/backup/quadstor/local/mode/vtltapeusage.pm +++ b/centreon-plugins/apps/backup/quadstor/local/mode/vtltapeusage.pm @@ -154,25 +154,24 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "hostname:s" => { name => 'hostname' }, - "remote" => { name => 'remote' }, - "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', default => 'vcconfig' }, - "command-path:s" => { name => 'command_path', default => '/quadstorvtl/bin' }, - "command-options:s" => { name => 'command_options', default => '-l -v %{vtl_name}' }, - "vtl-name:s" => { name => 'vtl_name' }, - "filter-name:s" => { name => 'filter_name' }, - "warning-status:s" => { name => 'warning_status', default => '' }, - "critical-status:s" => { name => 'critical_status', default => '%{status} !~ /active/i' }, - "units:s" => { name => 'units', default => '%' }, - "free" => { name => 'free' }, - }); + $options{options}->add_options(arguments => { + 'hostname:s' => { name => 'hostname' }, + 'remote' => { name => 'remote' }, + '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', default => 'vcconfig' }, + 'command-path:s' => { name => 'command_path', default => '/quadstorvtl/bin' }, + 'command-options:s' => { name => 'command_options', default => '-l -v %{vtl_name}' }, + 'vtl-name:s' => { name => 'vtl_name' }, + 'filter-name:s' => { name => 'filter_name' }, + 'warning-status:s' => { name => 'warning_status', default => '' }, + 'critical-status:s' => { name => 'critical_status', default => '%{status} !~ /active/i' }, + 'units:s' => { name => 'units', default => '%' }, + 'free' => { name => 'free' }, + }); return $self; } @@ -199,12 +198,15 @@ sub prefix_tape_output { sub manage_selection { my ($self, %options) = @_; - my ($stdout) = centreon::plugins::misc::execute(output => $self->{output}, - options => $self->{option_results}, - sudo => $self->{option_results}->{sudo}, - command => $self->{option_results}->{command}, - command_path => $self->{option_results}->{command_path}, - command_options => $self->{option_results}->{command_options}); + my ($stdout) = centreon::plugins::misc::execute( + output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => $self->{option_results}->{command}, + command_path => $self->{option_results}->{command_path}, + command_options => $self->{option_results}->{command_options} + ); + $self->{global}->{count} = 0; $self->{tape} = {}; #Pool Label Element Address Vtype WORM Size Used% Status diff --git a/centreon-plugins/cloud/aws/apigateway/mode/latency.pm b/centreon-plugins/cloud/aws/apigateway/mode/latency.pm index 9df684f66..37ccc606e 100644 --- a/centreon-plugins/cloud/aws/apigateway/mode/latency.pm +++ b/centreon-plugins/cloud/aws/apigateway/mode/latency.pm @@ -96,8 +96,8 @@ sub new { bless $self, $class; $options{options}->add_options(arguments => { - "api-name:s@" => { name => 'api_name' }, - "filter-metric:s" => { name => 'filter_metric' }, + 'api-name:s@' => { name => 'api_name' }, + 'filter-metric:s' => { name => 'filter_metric' }, }); return $self; diff --git a/centreon-plugins/cloud/aws/apigateway/mode/requests.pm b/centreon-plugins/cloud/aws/apigateway/mode/requests.pm index 9fb4bc2d9..f5e744433 100644 --- a/centreon-plugins/cloud/aws/apigateway/mode/requests.pm +++ b/centreon-plugins/cloud/aws/apigateway/mode/requests.pm @@ -97,8 +97,8 @@ sub new { bless $self, $class; $options{options}->add_options(arguments => { - "api-name:s@" => { name => 'api_name' }, - "filter-metric:s" => { name => 'filter_metric' }, + 'api-name:s@' => { name => 'api_name' }, + 'filter-metric:s' => { name => 'filter_metric' }, }); return $self; diff --git a/centreon-plugins/cloud/aws/kinesis/mode/recordsstats.pm b/centreon-plugins/cloud/aws/kinesis/mode/recordsstats.pm index 90d4f7e2d..11168e53f 100644 --- a/centreon-plugins/cloud/aws/kinesis/mode/recordsstats.pm +++ b/centreon-plugins/cloud/aws/kinesis/mode/recordsstats.pm @@ -136,8 +136,8 @@ sub new { bless $self, $class; $options{options}->add_options(arguments => { - "stream-name:s@" => { name => 'stream_name' }, - "filter-metric:s" => { name => 'filter_metric' }, + 'stream-name:s@' => { name => 'stream_name' }, + 'filter-metric:s' => { name => 'filter_metric' }, }); return $self; @@ -238,4 +238,4 @@ can be: 'records-get-iteratorage', 'records-get-volume', =back -=cut \ No newline at end of file +=cut diff --git a/centreon-plugins/cloud/aws/kinesis/mode/streams.pm b/centreon-plugins/cloud/aws/kinesis/mode/streams.pm index 40dcf4396..225f0b2dd 100644 --- a/centreon-plugins/cloud/aws/kinesis/mode/streams.pm +++ b/centreon-plugins/cloud/aws/kinesis/mode/streams.pm @@ -112,8 +112,8 @@ sub new { bless $self, $class; $options{options}->add_options(arguments => { - "stream-name:s@" => { name => 'stream_name' }, - "filter-metric:s" => { name => 'filter_metric' }, + 'stream-name:s@' => { name => 'stream_name' }, + 'filter-metric:s' => { name => 'filter_metric' }, }); return $self; @@ -214,4 +214,4 @@ can be: 'incoming-bytes', 'incoming-records', =back -=cut \ No newline at end of file +=cut diff --git a/centreon-plugins/storage/emc/celerra/local/mode/getreason.pm b/centreon-plugins/storage/emc/celerra/local/mode/getreason.pm index 123786a27..89ddb6dbf 100644 --- a/centreon-plugins/storage/emc/celerra/local/mode/getreason.pm +++ b/centreon-plugins/storage/emc/celerra/local/mode/getreason.pm @@ -84,19 +84,18 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); bless $self, $class; - $options{options}->add_options(arguments => - { - "hostname:s" => { name => 'hostname' }, - "remote" => { name => 'remote' }, - "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', default => 'getreason' }, - "command-path:s" => { name => 'command_path', default => '/nas/sbin' }, - "command-options:s" => { name => 'command_options', default => '2>&1' }, - }); + $options{options}->add_options(arguments => { + 'hostname:s' => { name => 'hostname' }, + 'remote' => { name => 'remote' }, + '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', default => 'getreason' }, + 'command-path:s' => { name => 'command_path', default => '/nas/sbin' }, + 'command-options:s' => { name => 'command_options', default => '2>&1' }, + }); return $self; } diff --git a/centreon-plugins/storage/emc/celerra/local/plugin.pm b/centreon-plugins/storage/emc/celerra/local/plugin.pm index 4b63ccbd1..1a9cebd3f 100644 --- a/centreon-plugins/storage/emc/celerra/local/plugin.pm +++ b/centreon-plugins/storage/emc/celerra/local/plugin.pm @@ -31,8 +31,8 @@ sub new { $self->{version} = '0.1'; %{$self->{modes}} = ( - 'getreason' => 'storage::emc::celerra::local::mode::getreason', - ); + 'getreason' => 'storage::emc::celerra::local::mode::getreason', + ); return $self; } diff --git a/centreon-plugins/storage/emc/clariion/plugin.pm b/centreon-plugins/storage/emc/clariion/plugin.pm index 265e13913..9307d612e 100644 --- a/centreon-plugins/storage/emc/clariion/plugin.pm +++ b/centreon-plugins/storage/emc/clariion/plugin.pm @@ -32,27 +32,22 @@ sub new { $self->{version} = '0.1'; %{$self->{modes}} = ( - 'cache' => 'centreon::common::emc::navisphere::mode::cache', - 'controller' => 'centreon::common::emc::navisphere::mode::controller', - 'disk' => 'centreon::common::emc::navisphere::mode::disk', - 'sp' => 'centreon::common::emc::navisphere::mode::sp', - 'faults' => 'centreon::common::emc::navisphere::mode::faults', - 'list-luns' => 'centreon::common::emc::navisphere::mode::listluns', - 'sp-info' => 'centreon::common::emc::navisphere::mode::spinfo', - 'port-state' => 'centreon::common::emc::navisphere::mode::portstate', - 'hba-state' => 'centreon::common::emc::navisphere::mode::hbastate', - ); + 'cache' => 'centreon::common::emc::navisphere::mode::cache', + 'controller' => 'centreon::common::emc::navisphere::mode::controller', + 'disk' => 'centreon::common::emc::navisphere::mode::disk', + 'sp' => 'centreon::common::emc::navisphere::mode::sp', + 'faults' => 'centreon::common::emc::navisphere::mode::faults', + 'list-luns' => 'centreon::common::emc::navisphere::mode::listluns', + 'sp-info' => 'centreon::common::emc::navisphere::mode::spinfo', + 'port-state' => 'centreon::common::emc::navisphere::mode::portstate', + 'hba-state' => 'centreon::common::emc::navisphere::mode::hbastate', + ); + $self->{custom_modes}{clariion} = 'centreon::common::emc::navisphere::custom::custom'; return $self; } -sub init { - my ($self, %options) = @_; - - $self->SUPER::init(%options); -} - 1; __END__ diff --git a/centreon-plugins/storage/emc/isilon/snmp/mode/clusterusage.pm b/centreon-plugins/storage/emc/isilon/snmp/mode/clusterusage.pm index 3c6b36c05..c581e9f3e 100644 --- a/centreon-plugins/storage/emc/isilon/snmp/mode/clusterusage.pm +++ b/centreon-plugins/storage/emc/isilon/snmp/mode/clusterusage.pm @@ -143,14 +143,13 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "warning-status:s" => { name => 'warning_status', default => '%{status} =~ /attn/' }, - "critical-status:s" => { name => 'critical_status', default => '%{status} =~ /down|invalid/' }, - "units:s" => { name => 'units', default => '%' }, - "free" => { name => 'free' }, - }); - + $options{options}->add_options(arguments => { + 'warning-status:s' => { name => 'warning_status', default => '%{status} =~ /attn/' }, + 'critical-status:s' => { name => 'critical_status', default => '%{status} =~ /down|invalid/' }, + 'units:s' => { name => 'units', default => '%' }, + 'free' => { name => 'free' }, + }); + return $self; } diff --git a/centreon-plugins/storage/emc/isilon/snmp/mode/hardware.pm b/centreon-plugins/storage/emc/isilon/snmp/mode/hardware.pm index 5346b5f4d..d50fa48fb 100644 --- a/centreon-plugins/storage/emc/isilon/snmp/mode/hardware.pm +++ b/centreon-plugins/storage/emc/isilon/snmp/mode/hardware.pm @@ -58,9 +58,7 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; - $options{options}->add_options(arguments => - { - }); + $options{options}->add_options(arguments => {}); return $self; } diff --git a/centreon-plugins/storage/emc/isilon/snmp/plugin.pm b/centreon-plugins/storage/emc/isilon/snmp/plugin.pm index f3400ea64..76adb13b6 100644 --- a/centreon-plugins/storage/emc/isilon/snmp/plugin.pm +++ b/centreon-plugins/storage/emc/isilon/snmp/plugin.pm @@ -31,9 +31,9 @@ sub new { $self->{version} = '1.0'; %{$self->{modes}} = ( - 'cluster-usage' => 'storage::emc::isilon::snmp::mode::clusterusage', - 'hardware' => 'storage::emc::isilon::snmp::mode::hardware', - ); + 'cluster-usage' => 'storage::emc::isilon::snmp::mode::clusterusage', + 'hardware' => 'storage::emc::isilon::snmp::mode::hardware', + ); return $self; } diff --git a/centreon-plugins/storage/emc/vplex/restapi/mode/storagevolumes.pm b/centreon-plugins/storage/emc/vplex/restapi/mode/storagevolumes.pm index 5c5c5850d..0d429369b 100644 --- a/centreon-plugins/storage/emc/vplex/restapi/mode/storagevolumes.pm +++ b/centreon-plugins/storage/emc/vplex/restapi/mode/storagevolumes.pm @@ -37,12 +37,11 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "cluster:s" => { name => 'cluster' }, - "filter:s@" => { name => 'filter' }, - "threshold-overload:s@" => { name => 'threshold_overload' }, - }); + $options{options}->add_options(arguments => { + 'cluster:s' => { name => 'cluster' }, + 'filter:s@' => { name => 'filter' }, + 'threshold-overload:s@' => { name => 'threshold_overload' }, + }); return $self; } @@ -91,10 +90,12 @@ sub run { my $vplex = $options{custom}; my $urlbase = '/vplex/clusters/'; - my $items = $vplex->get_items(url => $urlbase, - parent => 'cluster', - engine => $self->{option_results}->{cluster}, - obj => 'storage-elements/storage-volumes'); + my $items = $vplex->get_items( + url => $urlbase, + parent => 'cluster', + engine => $self->{option_results}->{cluster}, + obj => 'storage-elements/storage-volumes' + ); $self->{output}->output_add(severity => 'OK', short_msg => 'All storage volumes are OK'); diff --git a/centreon-plugins/storage/emc/vplex/restapi/plugin.pm b/centreon-plugins/storage/emc/vplex/restapi/plugin.pm index fb4c499f5..2510d6c12 100644 --- a/centreon-plugins/storage/emc/vplex/restapi/plugin.pm +++ b/centreon-plugins/storage/emc/vplex/restapi/plugin.pm @@ -31,14 +31,14 @@ sub new { $self->{version} = '1.0'; %{$self->{modes}} = ( - 'psus' => 'storage::emc::vplex::restapi::mode::psus', - 'fans' => 'storage::emc::vplex::restapi::mode::fans', - 'distributed-devices' => 'storage::emc::vplex::restapi::mode::distributeddevices', - 'cluster-devices' => 'storage::emc::vplex::restapi::mode::clusterdevices', - 'storage-volumes' => 'storage::emc::vplex::restapi::mode::storagevolumes', - 'directors' => 'storage::emc::vplex::restapi::mode::directors', - 'cluster-communication' => 'storage::emc::vplex::restapi::mode::clustercommunication', - ); + 'psus' => 'storage::emc::vplex::restapi::mode::psus', + 'fans' => 'storage::emc::vplex::restapi::mode::fans', + 'distributed-devices' => 'storage::emc::vplex::restapi::mode::distributeddevices', + 'cluster-devices' => 'storage::emc::vplex::restapi::mode::clusterdevices', + 'storage-volumes' => 'storage::emc::vplex::restapi::mode::storagevolumes', + 'directors' => 'storage::emc::vplex::restapi::mode::directors', + 'cluster-communication' => 'storage::emc::vplex::restapi::mode::clustercommunication', + ); $self->{custom_modes}{vplexapi} = 'storage::emc::vplex::restapi::custom::vplexapi'; return $self;