Fix generic device classification bug for devices w/o L1-L3 support

Commit 52275e92 made a small change in generic device classification
based on sysObjectID for devices that don't report Layer1 - Layer3
capabilities, in order to skip generic assignment if a more specific
class had already been determined. However this change contained an
error causing generic classification to fail.
Nex fix explicitly checks if class isn't more specific than SNMP::Info
before attempting to classify based on sysObjectID.
This commit is contained in:
Jeroen van Ingen
2011-09-21 17:04:48 +02:00
parent 52275e92af
commit e1f3fb3a44

View File

@@ -1499,7 +1499,7 @@ sub device_type {
if ( $desc =~ /HP\sVC\s/ ); if ( $desc =~ /HP\sVC\s/ );
# Generic device classification based upon sysObjectID # Generic device classification based upon sysObjectID
if ( defined($id) and !defined $objtype ) { if ( defined($id) and $objtype eq 'SNMP::Info') {
if ( defined $l3sysoidmap{$id} ) { if ( defined $l3sysoidmap{$id} ) {
$objtype = $l3sysoidmap{$id}; $objtype = $l3sysoidmap{$id};
} elsif ( defined $l2sysoidmap{$id}) { } elsif ( defined $l2sysoidmap{$id}) {