Return serial number for Cisco 3850 from entPhysicalSerialNum
This commit is contained in:
@@ -6,6 +6,14 @@ version 3.15 ()
|
||||
|
||||
* Offline mode and Cache export/priming.
|
||||
|
||||
[ENHANCEMENTS]
|
||||
|
||||
* Return serial number for Cisco 3850 from entPhysicalSerialNum
|
||||
|
||||
[BUG FIXES]
|
||||
|
||||
* Cisco SB serial number probably did not work
|
||||
|
||||
version 3.14 (2014-06-07)
|
||||
|
||||
[ENHANCEMENTS]
|
||||
|
||||
@@ -98,21 +98,17 @@ sub vendor {
|
||||
return 'cisco';
|
||||
}
|
||||
|
||||
# Walk the entPhysicalSerialNum table and return both the first serial
|
||||
# number found as well as the index of that entry.
|
||||
# Walk the entPhysicalSerialNum table and return the first serial found
|
||||
sub serial {
|
||||
my $ciscosb = shift;
|
||||
my $serial = undef;
|
||||
my $e_serial = $ciscosb->e_serial();
|
||||
|
||||
# Find entity table entry for this unit
|
||||
foreach my $e ( keys %$e_serial ) {
|
||||
if (defined ($e_serial->{$e}) and $e_serial->{$e} !~ /^\s*$/) {
|
||||
$index = $e;
|
||||
last;
|
||||
foreach my $e ( sort keys %$e_serial ) {
|
||||
if (defined $e_serial->{$e} and $e_serial->{$e} !~ /^\s*$/) {
|
||||
return $e_serial->{$e};
|
||||
}
|
||||
}
|
||||
return $e_serial->{$index} if defined $index;
|
||||
}
|
||||
|
||||
sub os_ver {
|
||||
|
||||
@@ -134,6 +134,23 @@ sub vendor {
|
||||
|
||||
sub cisco_comm_indexing { return 1; }
|
||||
|
||||
sub serial {
|
||||
my $c6500 = shift;
|
||||
|
||||
my $serial = $c6500->SUPER::serial();
|
||||
return $serial if defined $serial and $serial;
|
||||
|
||||
# now grab the table only if SUPER cannot find it
|
||||
my $e_serial = $c6500->e_serial();
|
||||
|
||||
# Find entity table entry for this unit
|
||||
foreach my $e ( sort keys %$e_serial ) {
|
||||
if (defined $e_serial->{$e} and $e_serial->{$e} !~ /^\s*$/) {
|
||||
return $e_serial->{$e};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Newer versions use the ETHERLIKE-MIB to report operational duplex.
|
||||
|
||||
sub i_duplex {
|
||||
@@ -389,6 +406,10 @@ Returns the Switch status: multiNode or standalone.
|
||||
|
||||
Return 1 if the switch (C<cvsSwitchMode>) is in multimode (VSS).
|
||||
|
||||
=item $c6500->serial()
|
||||
|
||||
Returns serial number of unit (falls back to C<entPhysicalSerialNum>).
|
||||
|
||||
=back
|
||||
|
||||
=head2 Global Methods imported from SNMP::Info::CiscoVTP
|
||||
|
||||
Reference in New Issue
Block a user