From 10049c62bc6c8498ca573b6aa32dacb6110f065c Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Mon, 28 Oct 2019 17:09:08 +0100 Subject: [PATCH] enhance indent --- .../symmetrix/dmx34/local/mode/hardware.pm | 53 +++++++++-------- .../emc/symmetrix/vmax/local/mode/hardware.pm | 59 ++++++++++--------- 2 files changed, 61 insertions(+), 51 deletions(-) diff --git a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm index 1a48b37a7..3ffd93773 100644 --- a/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm +++ b/centreon-plugins/storage/emc/symmetrix/dmx34/local/mode/hardware.pm @@ -76,20 +76,19 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; - $options{options}->add_options(arguments => - { - "file-health:s" => { name => 'file_health' }, - "file-health-env:s" => { name => 'file_health_env' }, - # Email - "email-warning:s" => { name => 'email_warning' }, - "email-critical:s" => { name => 'email_critical' }, - "email-smtp-host:s" => { name => 'email_smtp_host' }, - "email-smtp-username:s" => { name => 'email_smtp_username' }, - "email-smtp-password:s" => { name => 'email_smtp_password' }, - "email-smtp-from:s" => { name => 'email_smtp_from' }, - "email-smtp-options:s@" => { name => 'email_smtp_options' }, - "email-memory" => { name => 'email_memory' }, - }); + $options{options}->add_options(arguments => { + 'file-health:s' => { name => 'file_health' }, + 'file-health-env:s' => { name => 'file_health_env' }, + # Email + 'email-warning:s' => { name => 'email_warning' }, + 'email-critical:s' => { name => 'email_critical' }, + 'email-smtp-host:s' => { name => 'email_smtp_host' }, + 'email-smtp-username:s' => { name => 'email_smtp_username' }, + 'email-smtp-password:s' => { name => 'email_smtp_password' }, + 'email-smtp-from:s' => { name => 'email_smtp_from' }, + 'email-smtp-options:s@' => { name => 'email_smtp_options' }, + 'email-memory' => { name => 'email_memory' }, + }); $self->{statefile_cache} = centreon::plugins::statefile->new(%options); $self->{components_exec_load} = 0; @@ -218,19 +217,26 @@ sub send_email { return ; } - centreon::plugins::misc::mymodule_load(output => $self->{output}, module => 'Email::Send::SMTP::Gmail', - error_msg => "Cannot load module 'Email::Send::SMTP::Gmail'."); - my ($mail, $error) = Email::Send::SMTP::Gmail->new(-smtp => $self->{option_results}->{email_smtp_host}, - %smtp_options); + centreon::plugins::misc::mymodule_load( + output => $self->{output}, + module => 'Email::Send::SMTP::Gmail', + error_msg => "Cannot load module 'Email::Send::SMTP::Gmail'." + ); + my ($mail, $error) = Email::Send::SMTP::Gmail->new( + -smtp => $self->{option_results}->{email_smtp_host}, + %smtp_options + ); if ($mail == -1) { $self->{output}->add_option_msg(short_msg => "session error: " . $error); $self->{output}->option_exit(); } - my $result = $mail->send(-to => $smtp_to, - -from => $self->{option_results}->{email_smtp_from}, - -subject => defined($smtp_options{-subject}) ? $smtp_options{-subject} : $subject, - -body => $stdout, - -attachments => $self->{option_results}->{file_health} . ',' . $self->{option_results}->{file_health_env}); + my $result = $mail->send( + -to => $smtp_to, + -from => $self->{option_results}->{email_smtp_from}, + -subject => defined($smtp_options{-subject}) ? $smtp_options{-subject} : $subject, + -body => $stdout, + -attachments => $self->{option_results}->{file_health} . ',' . $self->{option_results}->{file_health_env} + ); $mail->bye(); if ($result == -1) { $self->{output}->add_option_msg(severity => 'UNKNOWN', short_msg => "problem to send the email"); @@ -291,4 +297,3 @@ The location of the environment storage file status (Should be something like: C =back =cut - \ No newline at end of file diff --git a/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/hardware.pm b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/hardware.pm index 3c1ceacf9..fcc1ac43f 100644 --- a/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/hardware.pm +++ b/centreon-plugins/storage/emc/symmetrix/vmax/local/mode/hardware.pm @@ -98,22 +98,21 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; - $options{options}->add_options(arguments => - { - "health-directory:s" => { name => 'health_directory' }, - "health-directory-pattern:s" => { name => 'health_directory_pattern' }, - "file-health-name:s" => { name => 'file_health_name', default => 'HealthCheck.log' }, - "file-health-env-name:s" => { name => 'file_health_env_name', default => 'sympl_env_health.log' }, - # Email - "email-warning:s" => { name => 'email_warning' }, - "email-critical:s" => { name => 'email_critical' }, - "email-smtp-host:s" => { name => 'email_smtp_host' }, - "email-smtp-username:s" => { name => 'email_smtp_username' }, - "email-smtp-password:s" => { name => 'email_smtp_password' }, - "email-smtp-from:s" => { name => 'email_smtp_from' }, - "email-smtp-options:s@" => { name => 'email_smtp_options' }, - "email-memory" => { name => 'email_memory' }, - }); + $options{options}->add_options(arguments => { + 'health-directory:s' => { name => 'health_directory' }, + 'health-directory-pattern:s' => { name => 'health_directory_pattern' }, + 'file-health-name:s' => { name => 'file_health_name', default => 'HealthCheck.log' }, + 'file-health-env-name:s' => { name => 'file_health_env_name', default => 'sympl_env_health.log' }, + # Email + 'email-warning:s' => { name => 'email_warning' }, + 'email-critical:s' => { name => 'email_critical' }, + 'email-smtp-host:s' => { name => 'email_smtp_host' }, + 'email-smtp-username:s' => { name => 'email_smtp_username' }, + 'email-smtp-password:s' => { name => 'email_smtp_password' }, + 'email-smtp-from:s' => { name => 'email_smtp_from' }, + 'email-smtp-options:s@' => { name => 'email_smtp_options' }, + 'email-memory' => { name => 'email_memory' }, + }); $self->{statefile_cache} = centreon::plugins::statefile->new(%options); $self->{components_exec_load} = 0; @@ -216,7 +215,7 @@ sub send_email { $send_email = 0 if ($status ne 'ok' && defined($prev_output) && $prev_output eq $subject); # recovery email $send_email = 1 if ($status eq 'ok' && defined($prev_status) && $prev_status ne 'ok'); - $self->{statefile_cache}->write(data => $self->{new_datas}); + $self->{statefile_cache}->write(data => $self->{new_datas}); } my $smtp_to = ''; @@ -237,19 +236,26 @@ sub send_email { return ; } - centreon::plugins::misc::mymodule_load(output => $self->{output}, module => 'Email::Send::SMTP::Gmail', - error_msg => "Cannot load module 'Email::Send::SMTP::Gmail'."); - my ($mail, $error) = Email::Send::SMTP::Gmail->new(-smtp => $self->{option_results}->{email_smtp_host}, - %smtp_options); + centreon::plugins::misc::mymodule_load( + output => $self->{output}, + module => 'Email::Send::SMTP::Gmail', + error_msg => "Cannot load module 'Email::Send::SMTP::Gmail'." + ); + my ($mail, $error) = Email::Send::SMTP::Gmail->new( + -smtp => $self->{option_results}->{email_smtp_host}, + %smtp_options + ); if ($mail == -1) { $self->{output}->add_option_msg(short_msg => "session error: " . $error); $self->{output}->option_exit(); } - my $result = $mail->send(-to => $smtp_to, - -from => $self->{option_results}->{email_smtp_from}, - -subject => defined($smtp_options{-subject}) ? $smtp_options{-subject} : $subject, - -body => $stdout, - -attachments => $self->{option_results}->{file_health} . "," . $self->{option_results}->{file_health_env}); + my $result = $mail->send( + -to => $smtp_to, + -from => $self->{option_results}->{email_smtp_from}, + -subject => defined($smtp_options{-subject}) ? $smtp_options{-subject} : $subject, + -body => $stdout, + -attachments => $self->{option_results}->{file_health} . "," . $self->{option_results}->{file_health_env} + ); $mail->bye(); if ($result == -1) { $self->{output}->add_option_msg(severity => 'UNKNOWN', short_msg => "problem to send the email"); @@ -318,4 +324,3 @@ Name of the environment storage file status (Default: sympl_env_health.log). =back =cut - \ No newline at end of file