155 lines
2.9 KiB
Perl
155 lines
2.9 KiB
Perl
# SNMP::Info::Layer3::Qtech - SNMP Interface to Qtech Devices
|
|
#
|
|
# Copyright (c) 2020 by The 135.
|
|
|
|
|
|
package SNMP::Info::Layer3::Qtech;
|
|
|
|
use strict;
|
|
use warnings;
|
|
use Exporter;
|
|
use SNMP::Info::Layer3;
|
|
|
|
@SNMP::Info::Layer3::Qtech::ISA = qw/SNMP::Info::Layer3 Exporter/;
|
|
@SNMP::Info::Layer3::Qtech::EXPORT_OK = qw//;
|
|
|
|
our ($VERSION, %GLOBALS, %FUNCS, %MIBS, %MUNGE);
|
|
|
|
$VERSION = '3.70-135';
|
|
|
|
%MIBS = ( %SNMP::Info::Layer3::MIBS, );
|
|
|
|
%GLOBALS = (
|
|
%SNMP::Info::Layer3::GLOBALS,
|
|
'hostname' => 'mib-2.47.1.1.1.1.7.1',
|
|
'model_oid' => 'mib-2.47.1.1.1.1.13.1',
|
|
'hw_oid' => 'mib-2.47.1.1.1.1.8.1',
|
|
'serial_oid' => 'mib-2.47.1.1.1.1.11.1',
|
|
'bootrom_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 model {
|
|
my $qtech = shift;
|
|
my $model = $qtech->model_oid;
|
|
my $hw = $qtech->hw_oid;
|
|
return $model . ' HW:' . $hw;
|
|
}
|
|
|
|
sub vendor {
|
|
return 'qtech';
|
|
}
|
|
|
|
sub os {
|
|
return 'qsw';
|
|
}
|
|
|
|
sub os_ver {
|
|
my $qtech = shift;
|
|
my $os_ver = $qtech->os_ver_oid;
|
|
return $os_ver . ' bootrom: ' . $qtech->bootrom_oid;
|
|
}
|
|
|
|
sub serial {
|
|
my $qtech = shift;
|
|
my $serial = $qtech->serial_oid;
|
|
return $serial;
|
|
}
|
|
|
|
1;
|
|
__END__
|
|
|
|
=head1 NAME
|
|
|
|
SNMP::Info::Layer3::Qtech - SNMP Interface to Qtech Devices
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
# Let SNMP::Info determine the correct subclass for you.
|
|
my $qtech = new SNMP::Info(
|
|
AutoSpecify => 1,
|
|
Debug => 1,
|
|
DestHost => 'myrouter',
|
|
Community => 'public',
|
|
Version => 2
|
|
)
|
|
or die "Can't connect to DestHost.\n";
|
|
|
|
my $class = $qtech->class();
|
|
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
|
|
|
=head1 DESCRIPTION
|
|
|
|
Subclass for Qtech 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 $qtech->model()
|
|
|
|
Returns the ID or else description.
|
|
|
|
=item $qtech->vendor()
|
|
|
|
Returns 'qtech'.
|
|
|
|
=item $qtech->serial()
|
|
|
|
Returns serial number.
|
|
|
|
=item $qtech->fwver()
|
|
|
|
Returns the firmware version.
|
|
|
|
=item $qtech->hwver()
|
|
|
|
Returns the hardware version.
|
|
|
|
=item $qtech->stp_i_root_port()
|
|
|
|
Returns the STP root port.
|
|
|
|
=back
|
|
|
|
=head2 Globals imported from SNMP::Info::Layer3
|
|
|
|
See documentation in L<SNMP::Info::Layer3/"GLOBALS"> for details.
|
|
|
|
=head1 TABLE METHODS
|
|
|
|
These are methods that return tables of information in the form of a reference
|
|
to a hash.
|
|
|
|
=over
|
|
|
|
=item $qtech->interfaces();
|
|
|
|
Returns the map between SNMP Interface Identifier (iid) and C<ifName>.
|
|
|
|
=back
|
|
|
|
=head2 Table Methods imported from SNMP::Info::Layer3
|
|
|
|
See documentation in L<SNMP::Info::Layer3/"TABLE METHODS"> for details.
|
|
|
|
=cut
|