Added Digital China vendor
Added ASAM 73xx model for Lucent
This commit is contained in:
Andrey Pazychev
2020-05-19 21:27:08 +03:00
parent fbf0bbe880
commit 08a632c053
3 changed files with 153 additions and 0 deletions

View File

@@ -1701,6 +1701,7 @@ sub device_type {
5624 => 'SNMP::Info::Layer3::Enterasys',
6027 => 'SNMP::Info::Layer3::Force10',
6141 => 'SNMP::Info::Layer3::Ciena',
6339 => 'SNMP::Info::Layer3::DigitalChina',
6486 => 'SNMP::Info::Layer3::AlcatelLucent',
6527 => 'SNMP::Info::Layer3::Timetra',
6672 => 'SNMP::Info::Layer2::Proscend',
@@ -1765,6 +1766,7 @@ sub device_type {
4526 => 'SNMP::Info::Layer2::Netgear',
5624 => 'SNMP::Info::Layer3::Enterasys',
6141 => 'SNMP::Info::Layer3::Ciena',
6339 => 'SNMP::Info::Layer3::DigitalChina',
6486 => 'SNMP::Info::Layer3::AlcatelLucent',
6672 => 'SNMP::Info::Layer2::Proscend',
8886 => 'SNMP::Info::Layer3::Raisecom',

View File

@@ -96,6 +96,8 @@ sub model {
my $id = $alu->id();
my $model = &SNMP::translateObj($id);
return 'ASAM 73xx' if $id =~ /637\.61\.1$/;
return $id unless defined $model;
$model =~ s/^device//;

View File

@@ -0,0 +1,149 @@
# SNMP::Info::Layer3::DigitalChina - SNMP Interface to DigitalChina Devices
#
# Copyright (c) 2020 by 135.
package SNMP::Info::Layer3::DigitalChina;
use strict;
use warnings;
use Exporter;
use SNMP::Info::Layer3;
@SNMP::Info::Layer3::DigitalChina::ISA = qw/SNMP::Info::Layer3 Exporter/;
@SNMP::Info::Layer3::DigitalChina::EXPORT_OK = qw//;
our ($VERSION, %GLOBALS, %MIBS, %FUNCS, %MUNGE);
$VERSION = '3.70-135';
%MIBS = ( %SNMP::Info::Layer3::MIBS, );
%GLOBALS = (
%SNMP::Info::Layer3::GLOBALS,
'model_oid' => 'mib-2.47.1.1.1.1.2.1',
'serial_oid' => 'mib-2.47.1.1.1.1.11.1',
'hw_oid' => 'mib-2.47.1.1.1.1.8.1',
'brom_oid' => 'mib-2.47.1.1.1.1.9.1',
'os_ver_oid' => 'mib-2.47.1.1.1.1.10.1',
);
%FUNCS = ( %SNMP::Info::Layer3::FUNCS, );
%MUNGE = ( %SNMP::Info::Layer3::MUNGE, );
sub vendor {
return 'digital-china';
}
sub os {
return 'snr-os';
}
sub os_ver {
my $obj = shift;
my $os_ver = $obj->os_ver_oid || undef;
my $brom = $obj->brom_oid || undef;
return $os_ver . ' bootrom:' . $brom
if defined $os_ver and defined $brom;
return $os_ver
if defined $os_ver;
return 'unknown';
}
sub model {
my $obj = shift;
my $model = $obj->model_oid || undef;
my $hwver = $obj->hwver || undef;
return $model . ' HW:' . $hwver
if defined $model and defined $hwver;
return $model
if defined $model;
return $obj->SUPER::model();
}
sub hwver {
my $obj = shift;
my $hwver = $obj->hw_oid || undef;
return $hwver
if defined $hwver;
}
sub serial {
my $obj = shift;
my $serial = $obj->serial_oid || undef;
return $serial
if defined $serial;
return $obj->SUPER::serial();
}
1;
__END__
=head1 NAME
SNMP::Info::Layer3::DigitalChina - SNMP Interface to DigitalChina Devices
=head1 SYNOPSIS
# Let SNMP::Info determine the correct subclass for you.
my $obj = new SNMP::Info(
AutoSpecify => 1,
Debug => 1,
DestHost => 'myrouter',
Community => 'public',
Version => 2
)
or die "Can't connect to DestHost.\n";
my $class = $obj->class();
print "SNMP::Info determined this device to fall under subclass : $class\n";
=head1 DESCRIPTION
Subclass for DigitalChina Devices
=head2 Inherited Classes
=over
=item SNMP::Info::Layer3
=back
=head2 Inherited Classes' MIBs
See L<SNMP::Info::Layer3/"Required MIBs"> for its own MIB requirements.
=head1 GLOBALS
These are methods that return scalar value from SNMP
=over
=item $obj->vendor()
Returns 'digital-china'
=item $obj->os()
Returns 'snr-os'
=item $obj->os_ver()
Returns the software version.
=item $obj->model()
Returns the model extracted.
=item $obj->serial()
Returns serial number.
=cut
=back