Return serial number for Cisco 3850 from entPhysicalSerialNum

This commit is contained in:
Oliver Gorwits
2014-06-10 13:12:08 +01:00
parent 6519570839
commit c24e63ec4c
3 changed files with 33 additions and 8 deletions

View File

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