From cc89e244fcaa055e257c754e60e802abebe56e23 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 29 Jul 2015 13:52:14 +0200 Subject: [PATCH] + Fix #112 --- snmp_standard/mode/interfaces.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/snmp_standard/mode/interfaces.pm b/snmp_standard/mode/interfaces.pm index 3a4da8fc8..46c739d6a 100644 --- a/snmp_standard/mode/interfaces.pm +++ b/snmp_standard/mode/interfaces.pm @@ -489,7 +489,8 @@ sub check_oids_label { my ($self, %options) = @_; foreach (('oid_filter', 'oid_display')) { - if (!defined($self->{oids_label}->{lc($self->{option_results}->{$_})})) { + $self->{option_results}->{$_} = lc($self->{option_results}->{$_}) if (defined($self->{option_results}->{$_})); + if (!defined($self->{oids_label}->{$self->{option_results}->{$_}})) { my $label = $_; $label =~ s/_/-/g; $self->{output}->add_option_msg(short_msg => "Unsupported oid in --" . $label . " option."); @@ -497,9 +498,13 @@ sub check_oids_label { } } - if (defined($self->{option_results}->{oid_extra_display}) && !defined($self->{oids_label}->{lc($self->{option_results}->{oid_extra_display})})) { - $self->{output}->add_option_msg(short_msg => "Unsupported oid in --oid-extra-display option."); - $self->{output}->option_exit(); + + if (defined($self->{option_results}->{oid_extra_display})) { + $self->{option_results}->{oid_extra_display} = lc($self->{option_results}->{oid_extra_display}); + if (!defined($self->{oids_label}->{$self->{option_results}->{oid_extra_display}})) { + $self->{output}->add_option_msg(short_msg => "Unsupported oid in --oid-extra-display option."); + $self->{output}->option_exit(); + } } } @@ -608,6 +613,7 @@ sub check_options { $self->{output}->option_exit(); } + $self->{get_speed} = 0; if ((!defined($self->{option_results}->{speed}) || $self->{option_results}->{speed} eq '') && ((!defined($self->{option_results}->{speed_in}) || $self->{option_results}->{speed_in} eq '') || (!defined($self->{option_results}->{speed_out}) || $self->{option_results}->{speed_out} eq ''))) {