Zyxel basic support
This commit is contained in:
@@ -25,7 +25,7 @@ our
|
|||||||
($VERSION, %FUNCS, %GLOBALS, %MIBS, %MUNGE, $AUTOLOAD, $INIT, $DEBUG, %SPEED_MAP,
|
($VERSION, %FUNCS, %GLOBALS, %MIBS, %MUNGE, $AUTOLOAD, $INIT, $DEBUG, %SPEED_MAP,
|
||||||
$NOSUCH, $BIGINT, $REPEATERS);
|
$NOSUCH, $BIGINT, $REPEATERS);
|
||||||
|
|
||||||
$VERSION = '3.70-135';
|
$VERSION = '3.70-135.20.5.1';
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
@@ -1676,6 +1676,7 @@ sub device_type {
|
|||||||
655 => 'SNMP::Info::Layer2::Carelink',
|
655 => 'SNMP::Info::Layer2::Carelink',
|
||||||
664 => 'SNMP::Info::Layer2::Adtran',
|
664 => 'SNMP::Info::Layer2::Adtran',
|
||||||
674 => 'SNMP::Info::Layer3::Dell',
|
674 => 'SNMP::Info::Layer3::Dell',
|
||||||
|
890 => 'SNMP::Info::Layer2::Zyxel',
|
||||||
1588 => 'SNMP::Info::Layer3::Foundry',
|
1588 => 'SNMP::Info::Layer3::Foundry',
|
||||||
1872 => 'SNMP::Info::Layer3::AlteonAD',
|
1872 => 'SNMP::Info::Layer3::AlteonAD',
|
||||||
1890 => 'SNMP::Info::Layer3::Redlion',
|
1890 => 'SNMP::Info::Layer3::Redlion',
|
||||||
@@ -1742,6 +1743,7 @@ sub device_type {
|
|||||||
655 => 'SNMP::Info::Layer2::Carelink',
|
655 => 'SNMP::Info::Layer2::Carelink',
|
||||||
664 => 'SNMP::Info::Layer2::Adtran',
|
664 => 'SNMP::Info::Layer2::Adtran',
|
||||||
674 => 'SNMP::Info::Layer3::Dell',
|
674 => 'SNMP::Info::Layer3::Dell',
|
||||||
|
890 => 'SNMP::Info::Layer2::Zyxel',
|
||||||
1872 => 'SNMP::Info::Layer3::AlteonAD',
|
1872 => 'SNMP::Info::Layer3::AlteonAD',
|
||||||
1890 => 'SNMP::Info::Layer3::Redlion',
|
1890 => 'SNMP::Info::Layer3::Redlion',
|
||||||
1916 => 'SNMP::Info::Layer3::Extreme',
|
1916 => 'SNMP::Info::Layer3::Extreme',
|
||||||
|
|||||||
120
lib/SNMP/Info/Layer2/Zyxel.pm
Executable file
120
lib/SNMP/Info/Layer2/Zyxel.pm
Executable file
@@ -0,0 +1,120 @@
|
|||||||
|
# SNMP::Info::Layer2::Zyxel - SNMP Interface to Zyxel Devices
|
||||||
|
#
|
||||||
|
# Copyright (c) 2020 by 135.
|
||||||
|
|
||||||
|
package SNMP::Info::Layer2::Zyxel;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use Exporter;
|
||||||
|
use SNMP::Info::Layer2;
|
||||||
|
|
||||||
|
@SNMP::Info::Layer2::Zyxel::ISA = qw/SNMP::Info::Layer2 Exporter/;
|
||||||
|
@SNMP::Info::Layer2::Zyxel::EXPORT_OK = qw//;
|
||||||
|
|
||||||
|
our ($VERSION, %GLOBALS, %MIBS, %FUNCS, %MUNGE);
|
||||||
|
|
||||||
|
$VERSION = '3.70-135';
|
||||||
|
|
||||||
|
# This will be filled in with the device's index into the EntPhysicalEntry
|
||||||
|
# table by the serial() function.
|
||||||
|
# our $index = undef;
|
||||||
|
|
||||||
|
%MIBS = ( %SNMP::Info::Layer2::MIBS, );
|
||||||
|
|
||||||
|
%GLOBALS = (
|
||||||
|
%SNMP::Info::Layer2::GLOBALS,
|
||||||
|
);
|
||||||
|
|
||||||
|
%FUNCS = ( %SNMP::Info::Layer2::FUNCS, );
|
||||||
|
|
||||||
|
%MUNGE = ( %SNMP::Info::Layer2::MUNGE, );
|
||||||
|
|
||||||
|
sub vendor {
|
||||||
|
return 'zyxel';
|
||||||
|
}
|
||||||
|
|
||||||
|
sub os {
|
||||||
|
return 'zynos';
|
||||||
|
}
|
||||||
|
|
||||||
|
sub os_ver {
|
||||||
|
my $obj = shift;
|
||||||
|
return 'unknown';
|
||||||
|
}
|
||||||
|
sub model {
|
||||||
|
my $obj = shift;
|
||||||
|
my $id = $obj->id;
|
||||||
|
if ($id =~ /890\.1\.5\.11\.11$/) {
|
||||||
|
return 'IES-1000 AAM1212-51';
|
||||||
|
}
|
||||||
|
return 'unknown';
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
__END__
|
||||||
|
|
||||||
|
=head1 NAME
|
||||||
|
|
||||||
|
SNMP::Info::Layer2::Zyxel - SNMP Interface to Zyxel 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 Zyxel Devices running IOS-like software
|
||||||
|
|
||||||
|
=head2 Inherited Classes
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
|
=item SNMP::Info::Layer2
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=head1 GLOBALS
|
||||||
|
|
||||||
|
These are methods that return scalar value from SNMP
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
|
=item $obj->vendor()
|
||||||
|
|
||||||
|
Returns 'zyxel'
|
||||||
|
|
||||||
|
=item $obj->os()
|
||||||
|
|
||||||
|
Returns 'zynos'
|
||||||
|
|
||||||
|
=item $obj->layers()
|
||||||
|
|
||||||
|
Ensures that layer two is reported, at least.
|
||||||
|
|
||||||
|
=item $obj->os_ver()
|
||||||
|
|
||||||
|
Returns the software version.
|
||||||
|
|
||||||
|
=item $obj->model
|
||||||
|
|
||||||
|
Returns the model extracted.
|
||||||
|
|
||||||
|
=item $obj->serial()
|
||||||
|
|
||||||
|
Returns serial number.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
=back
|
||||||
Reference in New Issue
Block a user