From ce9d7f658bd9dfd695d77ee4ec9140c1626c36be Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 20 Sep 2016 16:37:21 +0200 Subject: [PATCH] + some minor change --- centreon/plugins/options.pm | 2 +- centreon/plugins/perfdata.pm | 4 ++-- centreon/plugins/script.pm | 12 ++++++------ centreon/plugins/script_snmp.pm | 6 +++--- centreon/plugins/snmp.pm | 12 ++++++------ 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/centreon/plugins/options.pm b/centreon/plugins/options.pm index bbbc59b03..9395294ef 100644 --- a/centreon/plugins/options.pm +++ b/centreon/plugins/options.pm @@ -28,7 +28,7 @@ use warnings; my $alternative = 1; sub new { - my $class = shift; + my ($class) = @_; my $self = {}; bless $self, $class; diff --git a/centreon/plugins/perfdata.pm b/centreon/plugins/perfdata.pm index c857737fb..31dceeb79 100644 --- a/centreon/plugins/perfdata.pm +++ b/centreon/plugins/perfdata.pm @@ -114,9 +114,9 @@ sub trim { } sub parse_threshold { - my $self = shift; + my ($self, $perf) = @_; - my $perf = $self->trim($_[0]); + $perf = $self->trim($perf); my $arobase = 0; my $infinite_neg = 0; diff --git a/centreon/plugins/script.pm b/centreon/plugins/script.pm index 91dec7855..92a0e4a9e 100644 --- a/centreon/plugins/script.pm +++ b/centreon/plugins/script.pm @@ -34,7 +34,7 @@ my $global_version = 20160902; my $alternative_fatpacker = 0; sub new { - my $class = shift; + my ($class) = @_; my $self = {}; bless $self, $class; @@ -50,7 +50,7 @@ sub new { } sub prepare_destroy { - my $self = shift; + my ($self) = @_; delete $handlers{DIE}->{$self}; } @@ -79,7 +79,7 @@ sub handle_DIE { } sub get_plugin { - my $self = shift; + my ($self) = @_; ###### # Need to load global 'Output' and 'Options' @@ -122,7 +122,7 @@ sub get_plugin { } sub display_local_help { - my $self = shift; + my ($self) = @_; my $stdout; if ($self->{help}) { @@ -167,7 +167,7 @@ sub check_directory { } sub display_list_plugin { - my $self = shift; + my ($self) = @_; $self->{plugins_result} = {}; # Search file 'plugin.pm' @@ -247,7 +247,7 @@ sub check_relaunch { } sub run { - my $self = shift; + my ($self) = @_; $self->get_plugin(); diff --git a/centreon/plugins/script_snmp.pm b/centreon/plugins/script_snmp.pm index d04dbb017..e8d029a9e 100644 --- a/centreon/plugins/script_snmp.pm +++ b/centreon/plugins/script_snmp.pm @@ -125,7 +125,7 @@ sub init { } sub run { - my $self = shift; + my ($self) = @_; if ($self->{output}->is_disco_format()) { $self->{mode}->disco_format(); @@ -154,13 +154,13 @@ sub is_mode { } sub version { - my $self = shift; + my ($self) = @_; $self->{output}->add_option_msg(short_msg => "Plugin Version: " . $self->{version}); $self->{output}->option_exit(nolabel => 1); } sub list_mode { - my $self = shift; + my ($self) = @_; $self->{options}->display_help(); $self->{output}->add_option_msg(long_msg => "Modes Available:"); diff --git a/centreon/plugins/snmp.pm b/centreon/plugins/snmp.pm index 448a4cada..723cc43eb 100644 --- a/centreon/plugins/snmp.pm +++ b/centreon/plugins/snmp.pm @@ -596,7 +596,7 @@ sub set { } sub is_snmpv1 { - my $self = shift; + my ($self) = @_; if ($self->{snmp_params}->{Version} eq '1') { return 1; @@ -605,15 +605,15 @@ sub is_snmpv1 { } sub clean_oid { - my $self = shift; + my ($self, $oid) = @_; - $_[0] =~ s/\.$//; - $_[0] =~ s/^(\d)/\.$1/; - return $_[0]; + $oid =~ s/\.$//; + $oid =~ s/^(\d)/\.$1/; + return $oid; } sub check_oid_up { - my $self = shift; + my ($self) = @_; my ($current_oid, $end_oid) = @_; my @current_oid_splitted = split /\./, $current_oid;