Speedup in device_type() and more debugging info for GET operations and new()
This commit is contained in:
21
Info.pm
21
Info.pm
@@ -27,7 +27,7 @@ SNMP::Info - Perl5 Interface to Network devices through SNMP.
|
|||||||
|
|
||||||
=head1 VERSION
|
=head1 VERSION
|
||||||
|
|
||||||
SNMP::Info - Version 0.1
|
SNMP::Info - Version 0.2
|
||||||
|
|
||||||
=head1 AUTHOR
|
=head1 AUTHOR
|
||||||
|
|
||||||
@@ -209,6 +209,8 @@ back to the developers at snmp@warped.org for inclusion in the next version.
|
|||||||
|
|
||||||
=item SNMP::Info::Layer3::Foundry
|
=item SNMP::Info::Layer3::Foundry
|
||||||
|
|
||||||
|
=item SNMP::Info::Layer3::C3550
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
=head2 Details
|
=head2 Details
|
||||||
@@ -314,6 +316,9 @@ Required MIBs:
|
|||||||
AWCVX-MIB - Aironet Specific MIB values
|
AWCVX-MIB - Aironet Specific MIB values
|
||||||
IEEE802dot11-MIB - IEEE 802.11 Specific MIB (currently draft)
|
IEEE802dot11-MIB - IEEE 802.11 Specific MIB (currently draft)
|
||||||
|
|
||||||
|
|
||||||
|
=item * SNMP::Info::Layer3::C3550 - Cisco Catalyst 3550 Layer2/3 Switch
|
||||||
|
|
||||||
=item * SNMP::Info::Layer3::Foundry - Older Foundry Networks Devices Support
|
=item * SNMP::Info::Layer3::Foundry - Older Foundry Networks Devices Support
|
||||||
|
|
||||||
Inherits SNMP::Info::Bridge
|
Inherits SNMP::Info::Bridge
|
||||||
@@ -377,6 +382,8 @@ sub new {
|
|||||||
unless (defined $sess){
|
unless (defined $sess){
|
||||||
# How do i get error messages back from SNMP?
|
# How do i get error messages back from SNMP?
|
||||||
#print $SNMP::ErrorStr;
|
#print $SNMP::ErrorStr;
|
||||||
|
print "SNMP::Info::new() $sess->{ErrorStr}\n"
|
||||||
|
if ($DEBUG and $sess->{ErrorStr});
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -444,11 +451,11 @@ sub device_type {
|
|||||||
my $objtype = "SNMP::Info";
|
my $objtype = "SNMP::Info";
|
||||||
|
|
||||||
my $layers = $info->layers();
|
my $layers = $info->layers();
|
||||||
my $desc = $info->description();
|
|
||||||
|
|
||||||
# if we dont have sysServices, we dont have anything else either probably.
|
# if we dont have sysServices, we dont have anything else either probably.
|
||||||
return undef unless (defined $layers and length($layers));
|
return undef unless (defined $layers and length($layers));
|
||||||
|
|
||||||
|
my $desc = $info->description();
|
||||||
|
|
||||||
# Layer 3 Supported
|
# Layer 3 Supported
|
||||||
# (usually has layer2 as well, so we check for 3 first)
|
# (usually has layer2 as well, so we check for 3 first)
|
||||||
if ($info->has_layer(3)) {
|
if ($info->has_layer(3)) {
|
||||||
@@ -1140,6 +1147,11 @@ sub _global{
|
|||||||
$DEBUG and print "SNMP::Info::_global $attr : $oid\n";
|
$DEBUG and print "SNMP::Info::_global $attr : $oid\n";
|
||||||
my $val = $sess->get($oid);
|
my $val = $sess->get($oid);
|
||||||
|
|
||||||
|
if ($sess->{ErrorStr} ){
|
||||||
|
$DEBUG and print "SNMP::Info::_global($attr) $sess->{ErrorStr}\n";
|
||||||
|
return undef;
|
||||||
|
}
|
||||||
|
|
||||||
# Get the callback hash for data munging
|
# Get the callback hash for data munging
|
||||||
my $munge = $self->munge();
|
my $munge = $self->munge();
|
||||||
|
|
||||||
@@ -1190,6 +1202,9 @@ sub _set {
|
|||||||
|
|
||||||
my $rv = $sess->set($oid,$val);
|
my $rv = $sess->set($oid,$val);
|
||||||
|
|
||||||
|
print "SNMP::Info::_set $attr$iid $sess->{ErrorStr}\n"
|
||||||
|
if ($DEBUG and $sess->{ErrorStr});
|
||||||
|
|
||||||
return $rv;
|
return $rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user