enhance indent

This commit is contained in:
garnier-quentin 2019-09-12 18:03:41 +02:00
parent d156ccabcb
commit 52db696583
13 changed files with 92 additions and 98 deletions

View File

@ -154,25 +154,24 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options); my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {
{ 'hostname:s' => { name => 'hostname' },
"hostname:s" => { name => 'hostname' }, 'remote' => { name => 'remote' },
"remote" => { name => 'remote' }, 'ssh-option:s@' => { name => 'ssh_option' },
"ssh-option:s@" => { name => 'ssh_option' }, 'ssh-path:s' => { name => 'ssh_path' },
"ssh-path:s" => { name => 'ssh_path' }, 'ssh-command:s' => { name => 'ssh_command', default => 'ssh' },
"ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, 'timeout:s' => { name => 'timeout', default => 30 },
"timeout:s" => { name => 'timeout', default => 30 }, 'sudo' => { name => 'sudo' },
"sudo" => { name => 'sudo' }, 'command:s' => { name => 'command', default => 'vcconfig' },
"command:s" => { name => 'command', default => 'vcconfig' }, 'command-path:s' => { name => 'command_path', default => '/quadstorvtl/bin' },
"command-path:s" => { name => 'command_path', default => '/quadstorvtl/bin' }, 'command-options:s' => { name => 'command_options', default => '-l -v %{vtl_name}' },
"command-options:s" => { name => 'command_options', default => '-l -v %{vtl_name}' }, 'vtl-name:s' => { name => 'vtl_name' },
"vtl-name:s" => { name => 'vtl_name' }, 'filter-name:s' => { name => 'filter_name' },
"filter-name:s" => { name => 'filter_name' }, 'warning-status:s' => { name => 'warning_status', default => '' },
"warning-status:s" => { name => 'warning_status', default => '' }, 'critical-status:s' => { name => 'critical_status', default => '%{status} !~ /active/i' },
"critical-status:s" => { name => 'critical_status', default => '%{status} !~ /active/i' }, 'units:s' => { name => 'units', default => '%' },
"units:s" => { name => 'units', default => '%' }, 'free' => { name => 'free' },
"free" => { name => 'free' }, });
});
return $self; return $self;
} }
@ -199,12 +198,15 @@ sub prefix_tape_output {
sub manage_selection { sub manage_selection {
my ($self, %options) = @_; my ($self, %options) = @_;
my ($stdout) = centreon::plugins::misc::execute(output => $self->{output}, my ($stdout) = centreon::plugins::misc::execute(
options => $self->{option_results}, output => $self->{output},
sudo => $self->{option_results}->{sudo}, options => $self->{option_results},
command => $self->{option_results}->{command}, sudo => $self->{option_results}->{sudo},
command_path => $self->{option_results}->{command_path}, command => $self->{option_results}->{command},
command_options => $self->{option_results}->{command_options}); command_path => $self->{option_results}->{command_path},
command_options => $self->{option_results}->{command_options}
);
$self->{global}->{count} = 0; $self->{global}->{count} = 0;
$self->{tape} = {}; $self->{tape} = {};
#Pool Label Element Address Vtype WORM Size Used% Status #Pool Label Element Address Vtype WORM Size Used% Status

View File

@ -96,8 +96,8 @@ sub new {
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {
"api-name:s@" => { name => 'api_name' }, 'api-name:s@' => { name => 'api_name' },
"filter-metric:s" => { name => 'filter_metric' }, 'filter-metric:s' => { name => 'filter_metric' },
}); });
return $self; return $self;

View File

@ -97,8 +97,8 @@ sub new {
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {
"api-name:s@" => { name => 'api_name' }, 'api-name:s@' => { name => 'api_name' },
"filter-metric:s" => { name => 'filter_metric' }, 'filter-metric:s' => { name => 'filter_metric' },
}); });
return $self; return $self;

View File

@ -136,8 +136,8 @@ sub new {
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {
"stream-name:s@" => { name => 'stream_name' }, 'stream-name:s@' => { name => 'stream_name' },
"filter-metric:s" => { name => 'filter_metric' }, 'filter-metric:s' => { name => 'filter_metric' },
}); });
return $self; return $self;
@ -238,4 +238,4 @@ can be: 'records-get-iteratorage', 'records-get-volume',
=back =back
=cut =cut

View File

@ -112,8 +112,8 @@ sub new {
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {
"stream-name:s@" => { name => 'stream_name' }, 'stream-name:s@' => { name => 'stream_name' },
"filter-metric:s" => { name => 'filter_metric' }, 'filter-metric:s' => { name => 'filter_metric' },
}); });
return $self; return $self;
@ -214,4 +214,4 @@ can be: 'incoming-bytes', 'incoming-records',
=back =back
=cut =cut

View File

@ -84,19 +84,18 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {
{ 'hostname:s' => { name => 'hostname' },
"hostname:s" => { name => 'hostname' }, 'remote' => { name => 'remote' },
"remote" => { name => 'remote' }, 'ssh-option:s@' => { name => 'ssh_option' },
"ssh-option:s@" => { name => 'ssh_option' }, 'ssh-path:s' => { name => 'ssh_path' },
"ssh-path:s" => { name => 'ssh_path' }, 'ssh-command:s' => { name => 'ssh_command', default => 'ssh' },
"ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, 'timeout:s' => { name => 'timeout', default => 30 },
"timeout:s" => { name => 'timeout', default => 30 }, 'sudo' => { name => 'sudo' },
"sudo" => { name => 'sudo' }, 'command:s' => { name => 'command', default => 'getreason' },
"command:s" => { name => 'command', default => 'getreason' }, 'command-path:s' => { name => 'command_path', default => '/nas/sbin' },
"command-path:s" => { name => 'command_path', default => '/nas/sbin' }, 'command-options:s' => { name => 'command_options', default => '2>&1' },
"command-options:s" => { name => 'command_options', default => '2>&1' }, });
});
return $self; return $self;
} }

View File

@ -31,8 +31,8 @@ sub new {
$self->{version} = '0.1'; $self->{version} = '0.1';
%{$self->{modes}} = ( %{$self->{modes}} = (
'getreason' => 'storage::emc::celerra::local::mode::getreason', 'getreason' => 'storage::emc::celerra::local::mode::getreason',
); );
return $self; return $self;
} }

View File

@ -32,27 +32,22 @@ sub new {
$self->{version} = '0.1'; $self->{version} = '0.1';
%{$self->{modes}} = ( %{$self->{modes}} = (
'cache' => 'centreon::common::emc::navisphere::mode::cache', 'cache' => 'centreon::common::emc::navisphere::mode::cache',
'controller' => 'centreon::common::emc::navisphere::mode::controller', 'controller' => 'centreon::common::emc::navisphere::mode::controller',
'disk' => 'centreon::common::emc::navisphere::mode::disk', 'disk' => 'centreon::common::emc::navisphere::mode::disk',
'sp' => 'centreon::common::emc::navisphere::mode::sp', 'sp' => 'centreon::common::emc::navisphere::mode::sp',
'faults' => 'centreon::common::emc::navisphere::mode::faults', 'faults' => 'centreon::common::emc::navisphere::mode::faults',
'list-luns' => 'centreon::common::emc::navisphere::mode::listluns', 'list-luns' => 'centreon::common::emc::navisphere::mode::listluns',
'sp-info' => 'centreon::common::emc::navisphere::mode::spinfo', 'sp-info' => 'centreon::common::emc::navisphere::mode::spinfo',
'port-state' => 'centreon::common::emc::navisphere::mode::portstate', 'port-state' => 'centreon::common::emc::navisphere::mode::portstate',
'hba-state' => 'centreon::common::emc::navisphere::mode::hbastate', 'hba-state' => 'centreon::common::emc::navisphere::mode::hbastate',
); );
$self->{custom_modes}{clariion} = 'centreon::common::emc::navisphere::custom::custom'; $self->{custom_modes}{clariion} = 'centreon::common::emc::navisphere::custom::custom';
return $self; return $self;
} }
sub init {
my ($self, %options) = @_;
$self->SUPER::init(%options);
}
1; 1;
__END__ __END__

View File

@ -143,14 +143,13 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options); my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {
{ 'warning-status:s' => { name => 'warning_status', default => '%{status} =~ /attn/' },
"warning-status:s" => { name => 'warning_status', default => '%{status} =~ /attn/' }, 'critical-status:s' => { name => 'critical_status', default => '%{status} =~ /down|invalid/' },
"critical-status:s" => { name => 'critical_status', default => '%{status} =~ /down|invalid/' }, 'units:s' => { name => 'units', default => '%' },
"units:s" => { name => 'units', default => '%' }, 'free' => { name => 'free' },
"free" => { name => 'free' }, });
});
return $self; return $self;
} }

View File

@ -58,9 +58,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -31,9 +31,9 @@ sub new {
$self->{version} = '1.0'; $self->{version} = '1.0';
%{$self->{modes}} = ( %{$self->{modes}} = (
'cluster-usage' => 'storage::emc::isilon::snmp::mode::clusterusage', 'cluster-usage' => 'storage::emc::isilon::snmp::mode::clusterusage',
'hardware' => 'storage::emc::isilon::snmp::mode::hardware', 'hardware' => 'storage::emc::isilon::snmp::mode::hardware',
); );
return $self; return $self;
} }

View File

@ -37,12 +37,11 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options); my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {
{ 'cluster:s' => { name => 'cluster' },
"cluster:s" => { name => 'cluster' }, 'filter:s@' => { name => 'filter' },
"filter:s@" => { name => 'filter' }, 'threshold-overload:s@' => { name => 'threshold_overload' },
"threshold-overload:s@" => { name => 'threshold_overload' }, });
});
return $self; return $self;
} }
@ -91,10 +90,12 @@ sub run {
my $vplex = $options{custom}; my $vplex = $options{custom};
my $urlbase = '/vplex/clusters/'; my $urlbase = '/vplex/clusters/';
my $items = $vplex->get_items(url => $urlbase, my $items = $vplex->get_items(
parent => 'cluster', url => $urlbase,
engine => $self->{option_results}->{cluster}, parent => 'cluster',
obj => 'storage-elements/storage-volumes'); engine => $self->{option_results}->{cluster},
obj => 'storage-elements/storage-volumes'
);
$self->{output}->output_add(severity => 'OK', $self->{output}->output_add(severity => 'OK',
short_msg => 'All storage volumes are OK'); short_msg => 'All storage volumes are OK');

View File

@ -31,14 +31,14 @@ sub new {
$self->{version} = '1.0'; $self->{version} = '1.0';
%{$self->{modes}} = ( %{$self->{modes}} = (
'psus' => 'storage::emc::vplex::restapi::mode::psus', 'psus' => 'storage::emc::vplex::restapi::mode::psus',
'fans' => 'storage::emc::vplex::restapi::mode::fans', 'fans' => 'storage::emc::vplex::restapi::mode::fans',
'distributed-devices' => 'storage::emc::vplex::restapi::mode::distributeddevices', 'distributed-devices' => 'storage::emc::vplex::restapi::mode::distributeddevices',
'cluster-devices' => 'storage::emc::vplex::restapi::mode::clusterdevices', 'cluster-devices' => 'storage::emc::vplex::restapi::mode::clusterdevices',
'storage-volumes' => 'storage::emc::vplex::restapi::mode::storagevolumes', 'storage-volumes' => 'storage::emc::vplex::restapi::mode::storagevolumes',
'directors' => 'storage::emc::vplex::restapi::mode::directors', 'directors' => 'storage::emc::vplex::restapi::mode::directors',
'cluster-communication' => 'storage::emc::vplex::restapi::mode::clustercommunication', 'cluster-communication' => 'storage::emc::vplex::restapi::mode::clustercommunication',
); );
$self->{custom_modes}{vplexapi} = 'storage::emc::vplex::restapi::custom::vplexapi'; $self->{custom_modes}{vplexapi} = 'storage::emc::vplex::restapi::custom::vplexapi';
return $self; return $self;