Support for CiscoSB OS and Version (D. Tuecks)

This commit is contained in:
Oliver Gorwits
2015-11-28 20:19:33 +00:00
parent e6ad08733d
commit 2fada0c31c
2 changed files with 26 additions and 10 deletions

View File

@@ -1,5 +1,15 @@
SNMP::Info - Friendly OO-style interface to Network devices using SNMP.
version 3.31 ()
[ENHANCEMENTS]
* Support for CiscoSB OS and Version (D. Tuecks)
[BUG FIXES]
* Correct link to MIB tarball
version 3.30 (2015-11-16)
[ENHANCEMENTS]

View File

@@ -52,10 +52,6 @@ use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
$VERSION = '3.30';
# This will be filled in with the device's index into the EntPhysicalEntry
# table by the serial() function.
our $index = undef;
%GLOBALS = (
%SNMP::Info::Layer2::GLOBALS,
%SNMP::Info::Entity::GLOBALS,
@@ -98,6 +94,10 @@ sub vendor {
return 'cisco';
}
sub os {
return 'ros';
}
# Walk the entPhysicalSerialNum table and return the first serial found
sub serial {
my $ciscosb = shift;
@@ -113,20 +113,26 @@ sub serial {
sub os_ver {
my $ciscosb = shift;
my $os_ver = $ciscosb->e_swver();
my $e_swver = $ciscosb->e_swver();
return $os_ver->{$index} if defined $index;
foreach my $e ( sort keys %$e_swver ) {
if (defined $e_swver->{$e} and $e_swver->{$e} !~ /^\s*$/) {
return $e_swver->{$e};
}
}
}
# Grab e_model from Entity and tag on e_hwver
sub model {
my $ciscosb = shift;
my $e_model = $ciscosb->e_model();
my $e_model = $ciscosb->e_model();
my $e_hwver = $ciscosb->e_hwver();
if (defined ($index)) {
my $model = "$e_model->{$index} $e_hwver->{$index}";
return $model;
foreach my $e ( sort keys %$e_model ) {
if (defined $e_model->{$e} and $e_model->{$e} !~ /^\s*$/) {
my $model = "$e_model->{$e} $e_hwver->{$e}";
return $model;
}
}
return $ciscosb->description();
}