Dlink. Added HW to model info

This commit is contained in:
Andrey Pazychev
2020-05-20 17:12:25 +03:00
parent f2cbd163c9
commit 316a799fdb

View File

@@ -76,15 +76,9 @@ $VERSION = '3.70-135';
sub model {
my $dlink=shift;
my $id = $dlink->id();
my $model = &SNMP::translateObj($id);
return $id unless defined $model;
if (defined $model && $model !~ /dlink-products/) {
return $model;
} else {
#If don't have a device MIB
return $dlink->description();
}
my $hw = $dlink->hwver() || undef;
return $dlink->description() . ' HW:' . $hw if defined($hw);
return $dlink->description();
}
# ifDescr is the same for all interfaces in a class, but the ifName is
@@ -102,6 +96,15 @@ sub vendor {
return 'dlink';
}
sub os {
return 'dlink-os';
}
sub os_ver {
my $obj = shift;
return $obj->fwver();
}
sub serial {
my $dlink = shift;
my $model = $dlink->model();
@@ -134,8 +137,8 @@ sub fwver {
sub hwver {
my $dlink=shift;
my $model = $dlink->model();
my $id = $dlink->id();
my $model = &SNMP::translateObj($id);
my $hw;
if ($model =~ /1210/) {
#Due to the zoo of MIB from DLink by 1210 series
@@ -144,6 +147,9 @@ sub hwver {
$hw = $dlink->dlink_hw();
}
return $hw->{0} if ( defined $hw->{0} and $hw->{0} !~ /^\s*$/ and $hw->{0} !~ 'NOSUCHOBJECT');
$hw = $dlink->session()->get('rmon.19.3.0');
return $hw if defined($hw);
}
sub stp_i_root_port {