+ some minor change

This commit is contained in:
garnier-quentin 2016-09-20 16:37:21 +02:00
parent 832b0ce52e
commit ce9d7f658b
5 changed files with 18 additions and 18 deletions

View File

@ -28,7 +28,7 @@ use warnings;
my $alternative = 1;
sub new {
my $class = shift;
my ($class) = @_;
my $self = {};
bless $self, $class;

View File

@ -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;

View File

@ -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();

View File

@ -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:");

View File

@ -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;