Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43d1718618 | ||
|
|
d64f0d4a5e | ||
|
|
4a13ee8991 | ||
|
|
8764916086 | ||
|
|
78b0b77e38 | ||
|
|
8a7376f6df | ||
|
|
c9a36f12e6 | ||
|
|
8199e2a973 | ||
|
|
e1f3fb3a44 | ||
|
|
52275e92af | ||
|
|
5d9eec0992 | ||
|
|
cd9c637ba5 | ||
|
|
0bc405792a | ||
|
|
8fb36625bc | ||
|
|
674eca23b9 | ||
|
|
cfc1ead848 | ||
|
|
c41ffdfd2d | ||
|
|
df4708383b | ||
|
|
497c81a0c6 | ||
|
|
2c2f4a9ea1 | ||
|
|
5c44fc0b28 | ||
|
|
a54b446dae |
26
ChangeLog
26
ChangeLog
@@ -1,5 +1,27 @@
|
||||
SNMP::Info - Friendly OO-style interface to Network devices using SNMP.
|
||||
ChangeLog $Id$
|
||||
|
||||
version 2.06 (2011-09-28)
|
||||
|
||||
[NEW FEATURES]
|
||||
|
||||
* Support for PacketFront devices in new class L3::PacketFront
|
||||
* Support for Mikrotik devices in new class L3::Mikrotik
|
||||
* Support for HP VirtualConnect switches in new class L2::HPVC
|
||||
* Support for ADSL-LINE-MIB in new class AdslLine
|
||||
|
||||
[ENHANCEMENTS]
|
||||
|
||||
* POD clarification on i_speed() munging by Info.pm
|
||||
* Added i_stack_status method that can be used for finding the parent
|
||||
interface for e.g. ADSL interface speed determination
|
||||
|
||||
[BUG FIXES]
|
||||
|
||||
* [3344843] Fix returning serial() and os_ver() for web-managable HP
|
||||
switches, introduced by HP/HP4000 class split, reported by J R Binks
|
||||
* [2809033] Put L2-only Cisco blade switches in L3::C6500
|
||||
* [3408506] Fix uninitialized value in IPv6 when neighbor state is
|
||||
incomplete (Michael Borgelt)
|
||||
|
||||
version 2.05 (2011-06-23)
|
||||
+ Fix broken function call in L2::Aironet
|
||||
@@ -48,7 +70,7 @@ version 2.01 (06/12/09)
|
||||
* Updated POD and DeviceMatrix quite a bit
|
||||
* Added ENTITY-MIB to CiscoStats for better model handling above
|
||||
* Fix networkaddress handling in LLDP-MIB
|
||||
* Added CiscoConfig to L2::Aironet, L3::C3550 classes
|
||||
* Added CiscoConfig to L2::Aironet, L3::C3550 classes
|
||||
* Better SSID capabilities for L2::Aironet
|
||||
* Fix CDP vs LLDP in c_id() for HP Class
|
||||
* test_class.pl improvements
|
||||
|
||||
63
Info.pm
63
Info.pm
@@ -20,11 +20,10 @@ use Math::BigInt;
|
||||
@SNMP::Info::EXPORT_OK = qw//;
|
||||
|
||||
use vars
|
||||
qw/$VERSION $VERSION_CVS %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG %SPEED_MAP
|
||||
qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG %SPEED_MAP
|
||||
$NOSUCH $BIGINT $REPEATERS/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION_CVS = '$Id$';
|
||||
$VERSION = '2.06';
|
||||
|
||||
=head1 NAME
|
||||
|
||||
@@ -32,7 +31,7 @@ SNMP::Info - Object Oriented Perl5 Interface to Network devices and MIBs through
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
SNMP::Info - Version 2.05
|
||||
SNMP::Info - Version 2.06
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
@@ -227,6 +226,14 @@ For more info run C<perldoc> on any of the following module names.
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info::AdslLine
|
||||
|
||||
SNMP Interface to the ADSL-LINE-MIB for ADSL interfaces.
|
||||
|
||||
Requires the F<ADSL-LINE-MIB>, downloadable from Cisco.
|
||||
|
||||
See documentation in L<SNMP::Info::AdslLine> for details.
|
||||
|
||||
=item SNMP::Info::Airespace
|
||||
|
||||
F<AIRESPACE-WIRELESS-MIB> and F<AIRESPACE-SWITCHING-MIB>. Inherited by
|
||||
@@ -539,6 +546,12 @@ Requires F<HP-ICF-OID> and F<ENTITY-MIB> downloaded from HP.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer2::HP4000> for details.
|
||||
|
||||
=item SNMP::Info::Layer2::HPVC
|
||||
|
||||
Subclass for HP VirtualConnect Switches
|
||||
|
||||
See documentation in L<SNMP::Info::Layer2::HPVC> for details.
|
||||
|
||||
=item SNMP::Info::Layer2::N2270
|
||||
|
||||
Subclass for Nortel 2270 wireless switches.
|
||||
@@ -706,6 +719,12 @@ Subclass for Generic Microsoft Routers running Microsoft Windows OS.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::Microsoft> for details.
|
||||
|
||||
=item SNMP::Info::Layer3::Mikrotik
|
||||
|
||||
Subclass for Mikrotik devices running RouterOS.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::Mikrotik> for details.
|
||||
|
||||
=item SNMP::Info::Layer3::N1600
|
||||
|
||||
Subclass for Nortel Ethernet Routing Switch 1600 series.
|
||||
@@ -724,6 +743,12 @@ Subclass for Juniper NetScreen.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::Netscreen> for details.
|
||||
|
||||
=item SNMP::Info::Layer3::PacketFront
|
||||
|
||||
Subclass for PacketFront DRG series CPE.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::PacketFront> for details.
|
||||
|
||||
=item SNMP::Info::Layer3::Passport
|
||||
|
||||
Subclass for Nortel Ethernet Routing Switch/Passport 8000 series and Accelar
|
||||
@@ -1218,7 +1243,9 @@ sub device_type {
|
||||
6486 => 'SNMP::Info::Layer3::AlcatelLucent',
|
||||
6527 => 'SNMP::Info::Layer3::Timetra',
|
||||
8072 => 'SNMP::Info::Layer3::NetSNMP',
|
||||
9303 => 'SNMP::Info::Layer3::PacketFront',
|
||||
12325 => 'SNMP::Info::Layer3::Pf',
|
||||
14988 => 'SNMP::Info::Layer3::Mikrotik',
|
||||
30065 => 'SNMP::Info::Layer3::Arista',
|
||||
);
|
||||
|
||||
@@ -1243,7 +1270,7 @@ sub device_type {
|
||||
$id = $1 if ( defined($id) && $id =~ /^\.1\.3\.6\.1\.4\.1\.(\d+)/ );
|
||||
|
||||
if ($info->debug()) {
|
||||
print "SNMP::Info $VERSION ($VERSION_CVS)\n";
|
||||
print "SNMP::Info $VERSION\n";
|
||||
print "SNMP::Info::device_type() layers:$layers id:$id sysDescr:\"$desc\"\n";
|
||||
}
|
||||
|
||||
@@ -1318,6 +1345,10 @@ sub device_type {
|
||||
$objtype = 'SNMP::Info::Layer3::CiscoFWSM'
|
||||
if ( $desc =~ /Cisco Firewall Services Module/i );
|
||||
|
||||
# HP VirtualConnect blade switches
|
||||
$objtype = 'SNMP::Info::Layer2::HPVC'
|
||||
if ( $desc =~ /HP\sVC\s/ );
|
||||
|
||||
# Generic device classification based upon sysObjectID
|
||||
if ( ( $objtype eq 'SNMP::Info::Layer3' )
|
||||
and ( defined($id) )
|
||||
@@ -1351,6 +1382,10 @@ sub device_type {
|
||||
$objtype = 'SNMP::Info::Layer3::C3550'
|
||||
if ( $desc =~ /(C3550|ME340x)/ );
|
||||
|
||||
# Cisco blade switches, CBS30x0 and CBS31x0 models with L2 only
|
||||
$objtype = 'SNMP::Info::Layer3::C6500'
|
||||
if ( $desc =~ /cisco/i and $desc =~ /CBS3[0-9A-Za-z]{3}/ );
|
||||
|
||||
# Cisco 2970
|
||||
$objtype = 'SNMP::Info::Layer3::C6500'
|
||||
if ( $desc =~ /(C2970|C2960)/ );
|
||||
@@ -1415,6 +1450,10 @@ sub device_type {
|
||||
if (
|
||||
$desc =~ /Nortel\s+(Networks\s+)??WLAN\s+-\s+Security\s+Switch/ );
|
||||
|
||||
# HP VirtualConnect blade switches
|
||||
$objtype = 'SNMP::Info::Layer2::HPVC'
|
||||
if ( $desc =~ /HP\sVC\s/ );
|
||||
|
||||
# Generic device classification based upon sysObjectID
|
||||
if ( ( $objtype eq 'SNMP::Info::Layer2' )
|
||||
and ( defined($id) )
|
||||
@@ -1468,8 +1507,12 @@ sub device_type {
|
||||
$objtype = 'SNMP::Info::Layer3::Cisco'
|
||||
if ( $desc =~ /Cisco Adaptive Security Appliance/i );
|
||||
|
||||
# HP VirtualConnect blade switches
|
||||
$objtype = 'SNMP::Info::Layer2::HPVC'
|
||||
if ( $desc =~ /HP\sVC\s/ );
|
||||
|
||||
# Generic device classification based upon sysObjectID
|
||||
if ( defined($id) ) {
|
||||
if ( defined($id) and $objtype eq 'SNMP::Info') {
|
||||
if ( defined $l3sysoidmap{$id} ) {
|
||||
$objtype = $l3sysoidmap{$id};
|
||||
} elsif ( defined $l2sysoidmap{$id}) {
|
||||
@@ -2269,6 +2312,9 @@ ALTEON-TS-PHYSICAL-MIB::agPortCurCfgPortName.
|
||||
'i_qlen_out' => 'ifOutQLen',
|
||||
'i_specific' => 'ifSpecific',
|
||||
|
||||
# IF-MIB::IfStackTable
|
||||
'i_stack_status' => 'ifStackStatus',
|
||||
|
||||
# IP Address Table
|
||||
'ip_index' => 'ipAdEntIfIndex',
|
||||
'ip_table' => 'ipAdEntAddr',
|
||||
@@ -2555,6 +2601,11 @@ Makes human friendly speed ratings using %SPEED_MAP
|
||||
'2488000000' => 'OC-48',
|
||||
)
|
||||
|
||||
Note: high speed interfaces (usually 1 Gbps or faster) have their link
|
||||
speed in C<ifHighSpeed>. i_speed() automatically determines whether to use
|
||||
C<ifSpeed> or C<ifHighSpeed>; if the latter is used, the value is munged by
|
||||
munge_highspeed(). SNMP::Info can return speeds up to terabit levels this way.
|
||||
|
||||
=cut
|
||||
|
||||
%SPEED_MAP = (
|
||||
|
||||
172
Info/AdslLine.pm
Normal file
172
Info/AdslLine.pm
Normal file
@@ -0,0 +1,172 @@
|
||||
# SNMP::Info::AdslLine
|
||||
#
|
||||
# Copyright (c) 2009 Alexander Hartmaier
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the University of California, Santa Cruz nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::AdslLine;
|
||||
|
||||
use strict;
|
||||
use Exporter;
|
||||
use SNMP::Info;
|
||||
|
||||
@SNMP::Info::AdslLine::ISA = qw/SNMP::Info Exporter/;
|
||||
@SNMP::Info::AdslLine::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = ( 'ADSL-LINE-MIB' => 'adslLineType' );
|
||||
|
||||
%GLOBALS = ();
|
||||
|
||||
%FUNCS = (
|
||||
# ADSL-LINE-MIB::adslAtucChanTable
|
||||
'adsl_atuc_interleave_delay' => 'adslAtucChanInterleaveDelay',
|
||||
'adsl_atuc_curr_tx_rate' => 'adslAtucChanCurrTxRate',
|
||||
'adsl_atuc_prev_tx_rate' => 'adslAtucChanPrevTxRate',
|
||||
'adsl_atuc_crc_block_len' => 'adslAtucChanCrcBlockLength',
|
||||
|
||||
# ADSL-LINE-MIB::adslAturChanTable
|
||||
'adsl_atur_interleave_delay' => 'adslAturChanInterleaveDelay',
|
||||
'adsl_atur_curr_tx_rate' => 'adslAturChanCurrTxRate',
|
||||
'adsl_atur_prev_tx_rate' => 'adslAturChanPrevTxRate',
|
||||
'adsl_atur_crc_block_len' => 'adslAturChanCrcBlockLength',
|
||||
);
|
||||
|
||||
%MUNGE = ();
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::AdslLine - SNMP Interface to the ADSL-LINE-MIB
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Alexander Hartmaier
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $info = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
DestHost => 'myrouter',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $info->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SNMP::Info::AdslLine is a subclass of SNMP::Info that provides
|
||||
information about the adsl interfaces of a device.
|
||||
|
||||
Use or create in a subclass of SNMP::Info. Do not use directly.
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
none.
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item F<ADSL-LINE-MIB>
|
||||
|
||||
=back
|
||||
|
||||
MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
=over
|
||||
|
||||
=item none
|
||||
|
||||
=back
|
||||
|
||||
=head1 TABLE METHODS
|
||||
|
||||
=head2 ATUC channel table (C<adslAtucChanTable>)
|
||||
|
||||
This table provides one row for each ATUC channel.
|
||||
ADSL channel interfaces are those ifEntries where ifType
|
||||
is equal to adslInterleave(124) or adslFast(125).
|
||||
|
||||
=over
|
||||
|
||||
=item $info->adsl_atuc_interleave_delay()
|
||||
|
||||
(C<adslAtucChanInterleaveDelay>)
|
||||
|
||||
=item $info->adsl_atuc_curr_tx_rate()
|
||||
|
||||
(C<adslAtucChanCurrTxRate>)
|
||||
|
||||
=item $info->adsl_atuc_prev_tx_rate()
|
||||
|
||||
(C<adslAtucChanPrevTxRate>)
|
||||
|
||||
=item $info->adsl_atuc_crc_block_len()
|
||||
|
||||
(C<adslAtucChanCrcBlockLength>)
|
||||
|
||||
=back
|
||||
|
||||
=head2 ATUR channel table (C<adslAturChanTable>)
|
||||
|
||||
This table provides one row for each ATUR channel.
|
||||
ADSL channel interfaces are those ifEntries where ifType
|
||||
is equal to adslInterleave(124) or adslFast(125).
|
||||
|
||||
=over
|
||||
|
||||
=item $info->adsl_atur_interleave_delay()
|
||||
|
||||
(C<adslAturChanInterleaveDelay>)
|
||||
|
||||
=item $info->adsl_atur_curr_tx_rate()
|
||||
|
||||
(C<adslAturChanCurrTxRate>)
|
||||
|
||||
=item $info->adsl_atur_prev_tx_rate()
|
||||
|
||||
(C<adslAturChanPrevTxRate>)
|
||||
|
||||
=item $info->adsl_atur_crc_block_len()
|
||||
|
||||
(C<adslAturChanCrcBlockLength>)
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
'BRIDGE-MIB' => 'dot1dBaseBridgeAddress',
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %FUNCS %GLOBALS %MIBS %MUNGE $INIT/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
# Five data structures required by SNMP::Info
|
||||
%MIBS = ( 'CISCO-CDP-MIB' => 'cdpGlobalRun' );
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
'CISCO-CONFIG-COPY-MIB' => 'ccCopyTable',
|
||||
|
||||
@@ -38,7 +38,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = ( 'CISCO-IMAGE-MIB' => 'ciscoImageString', );
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ use Exporter;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE %PAECAPABILITIES/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
'CISCO-PORT-SECURITY-MIB' => 'ciscoPortSecurityMIB',
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = ( 'CISCO-POWER-ETHERNET-EXT-MIB' => 'cpeExtPsePortEntPhyIndex',
|
||||
'CISCO-CDP-MIB' => 'cdpCachePowerConsumption' );
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = ( 'CISCO-CLASS-BASED-QOS-MIB' => 'cbQosIfIndex', );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = ( 'CISCO-RTTMON-MIB' => 'rttMonCtrlAdminOwner', );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE %PORTSTAT/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = ( 'CISCO-STACK-MIB' => 'ciscoStackMIB', );
|
||||
|
||||
@@ -159,7 +159,7 @@ sub i_duplex {
|
||||
next if ( defined $partial and $iid !~ /^$partial$/ );
|
||||
|
||||
# Test for gigabit
|
||||
if ( $p_duplex_cap->{$port} == 0 ) {
|
||||
if ( $p_duplex_cap->{$port} && $p_duplex_cap->{$port} == 0 ) {
|
||||
$i_duplex->{$iid} = 'full';
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ sub i_duplex_admin {
|
||||
next if ( defined $partial and $iid !~ /^$partial$/ );
|
||||
|
||||
# Test for gigabit
|
||||
if ( $p_duplex_cap->{$port} == 0 ) {
|
||||
if ( $p_duplex_cap->{$port} && $p_duplex_cap->{$port} == 1 ) {
|
||||
$i_duplex_admin->{$iid} = 'full';
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
'SNMPv2-MIB' => 'sysDescr',
|
||||
@@ -382,14 +382,14 @@ Returns ios_cpu_5min() or cat_cpu5min(), whichever is available.
|
||||
|
||||
Returns mem_free() + mem_used()
|
||||
|
||||
=item $ciscostats->os()
|
||||
|
||||
Tries to parse if device is running IOS or CatOS from description()
|
||||
|
||||
=item $ciscostats->vendor()
|
||||
|
||||
'cisco'
|
||||
|
||||
=item $ciscostats->os()
|
||||
|
||||
Tries to parse if device is running IOS or CatOS from description()
|
||||
|
||||
Available values :
|
||||
|
||||
=over
|
||||
|
||||
@@ -35,7 +35,7 @@ use SNMP::Info;
|
||||
use SNMP::Info::Bridge;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE %PORTSTAT $INIT/;
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
@SNMP::Info::CiscoStpExtensions::ISA = qw/SNMP::Info::Bridge SNMP::Info Exporter/;
|
||||
@SNMP::Info::CiscoStpExtensions::EXPORT_OK = qw//;
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
'CISCO-VTP-MIB' => 'vtpVlanName',
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = ( 'ENTITY-MIB' => 'entPhysicalSerialNum' );
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = ( 'EtherLike-MIB' => 'etherMIB' );
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = ( 'FOUNDRY-SN-SWITCH-GROUP-MIB' => 'snFdpGlobalRun' );
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ use Exporter;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = ( 'IEEE802dot11-MIB' => 'dot11DesiredSSID', );
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ use constant {
|
||||
IPV6MIB => 3,
|
||||
};
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ sub ipv6_n2p_mac {
|
||||
$v6addr = join('.', $addrtype, $addrsize, $v6addr);
|
||||
$addrtype = 2;
|
||||
}
|
||||
if ($addrtype == 2) { # IPv6
|
||||
if (($addrtype == 2) && (defined $phys_addr->{$row})) { # IPv6
|
||||
$return->{$row} = substr($phys_addr->{$row}, 0, 17);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
'LLDP-MIB' => 'lldpLocSysCapEnabled',
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = ( %SNMP::Info::MIBS, 'SNMP-REPEATER-MIB' => 'rptrPortGroupIndex' );
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::Layer1;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
# Set for No CDP
|
||||
%GLOBALS = ( %SNMP::Info::Layer1::GLOBALS, 'root_ip' => 'actualIPAddr', );
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::Layer1;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
# Set for No CDP
|
||||
%GLOBALS = ( %SNMP::Info::Layer1::GLOBALS, );
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer1;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer1::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -45,7 +45,7 @@ use SNMP::Info::PowerEthernet;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS, %SNMP::Info::Bridge::MIBS,
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::Airespace;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS, %SNMP::Info::Bridge::MIBS,
|
||||
|
||||
@@ -49,7 +49,7 @@ use SNMP::Info::IEEE802dot11;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::IEEE802dot11::GLOBALS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::Layer1;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%GLOBALS = ( %SNMP::Info::Layer2::GLOBALS );
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
# Set for No CDP
|
||||
%GLOBALS = (
|
||||
|
||||
@@ -46,7 +46,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS, %SNMP::Info::LLDP::MIBS,
|
||||
|
||||
@@ -46,7 +46,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer2::GLOBALS,
|
||||
|
||||
@@ -47,7 +47,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer2::GLOBALS, %SNMP::Info::CiscoConfig::GLOBALS,
|
||||
|
||||
@@ -49,7 +49,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS, %SNMP::Info::CiscoPortSecurity::MIBS,
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::SONMP;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
|
||||
@@ -50,7 +50,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS, %SNMP::Info::CiscoConfig::MIBS,
|
||||
|
||||
@@ -44,7 +44,7 @@ use SNMP::Info::MAU;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS, %SNMP::Info::FDP::MIBS,
|
||||
|
||||
@@ -46,7 +46,7 @@ use SNMP::Info::CDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %PORTSTAT %MODEL_MAP %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
@@ -61,6 +61,7 @@ $VERSION = '2.05';
|
||||
'HP-ICF-CHASSIS' => 'hpicfSensorObjectId',
|
||||
'HP-ICF-BRIDGE' => 'hpicfBridgeRstpForceVersion',
|
||||
'HP-ICF-POE-MIB' => 'hpicfPoePethPsePortCurrent',
|
||||
'SEMI-MIB' => 'hpHttpMgSerialNumber',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
@@ -69,11 +70,13 @@ $VERSION = '2.05';
|
||||
%SNMP::Info::LLDP::GLOBALS,
|
||||
%SNMP::Info::CDP::GLOBALS,
|
||||
'serial1' => 'entPhysicalSerialNum.1',
|
||||
'serial2' => 'hpHttpMgSerialNumber.0',
|
||||
'hp_cpu' => 'hpSwitchCpuStat.0',
|
||||
'hp_mem_total' => 'hpGlobalMemTotalBytes.1',
|
||||
'mem_free' => 'hpGlobalMemFreeBytes.1',
|
||||
'mem_used' => 'hpGlobalMemAllocBytes.1',
|
||||
'os_version' => 'hpSwitchOsVersion.0',
|
||||
'os_version2' => 'hpHttpMgVersion.0',
|
||||
'os_bin' => 'hpSwitchRomVersion.0',
|
||||
'mac' => 'hpSwitchBaseMACAddress.0',
|
||||
'rstp_ver' => 'hpicfBridgeRstpForceVersion',
|
||||
@@ -223,7 +226,7 @@ sub os {
|
||||
|
||||
sub os_ver {
|
||||
my $hp = shift;
|
||||
my $os_version = $hp->os_version();
|
||||
my $os_version = $hp->os_version() || $hp->os_version2();
|
||||
return $os_version if defined $os_version;
|
||||
|
||||
# Some older ones don't have this value,so we cull it from the description
|
||||
@@ -234,6 +237,16 @@ sub os_ver {
|
||||
return;
|
||||
}
|
||||
|
||||
# Regular managed ProCurve switches have the serial num in entity mib,
|
||||
# the web-managed models in the semi mib (hphttpmanageable).
|
||||
sub serial {
|
||||
my $hp = shift;
|
||||
|
||||
my $serial = $hp->serial1() || $hp->serial2() || undef;;
|
||||
|
||||
return $serial;
|
||||
}
|
||||
|
||||
# Lookup model number, and translate the part number to the common number
|
||||
sub model {
|
||||
my $hp = shift;
|
||||
@@ -827,6 +840,10 @@ the description field.
|
||||
|
||||
C<hpSwitchOsVersion.0>
|
||||
|
||||
=item $hp->serial()
|
||||
|
||||
Returns serial number if available through SNMP
|
||||
|
||||
=item $hp->slots()
|
||||
|
||||
Returns number of entries in $hp->e_name that have 'slot' in them.
|
||||
|
||||
@@ -44,7 +44,7 @@ use SNMP::Info::CDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %PORTSTAT %MODEL_MAP %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
209
Info/Layer2/HPVC.pm
Normal file
209
Info/Layer2/HPVC.pm
Normal file
@@ -0,0 +1,209 @@
|
||||
# SNMP::Info::Layer2::HPVC - SNMP Interface to HP VirtualConnect Switches
|
||||
#
|
||||
# Copyright (c) 2011 Jeroen van Ingen
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the University of California, Santa Cruz nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer2::HPVC;
|
||||
|
||||
use strict;
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer2;
|
||||
|
||||
@SNMP::Info::Layer2::HPVC::ISA
|
||||
= qw/SNMP::Info::Layer2 Exporter/;
|
||||
@SNMP::Info::Layer2::HPVC::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
'HPVC-MIB' => 'vcDomainName',
|
||||
'CPQSINFO-MIB' => 'cpqSiSysSerialNum',
|
||||
'HPVCMODULE-MIB' => 'vcModuleDomainName',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer2::GLOBALS,
|
||||
'serial1' => 'cpqSiSysSerialNum.0',
|
||||
'os_ver' => 'cpqHoSWRunningVersion.1',
|
||||
'os_bin' => 'cpqHoFwVerVersion.1',
|
||||
'productname' => 'cpqSiProductName.0',
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer2::FUNCS,
|
||||
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
# Inherit all the built in munging
|
||||
%SNMP::Info::Layer2::MUNGE,
|
||||
);
|
||||
|
||||
|
||||
# Method Overrides
|
||||
|
||||
sub os {
|
||||
return 'hpvc';
|
||||
}
|
||||
|
||||
sub vendor {
|
||||
return 'hp';
|
||||
}
|
||||
|
||||
sub model {
|
||||
my $hp = shift;
|
||||
return $hp->productname();
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer2::HPVC - SNMP Interface to HP VirtualConnect Switches
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Jeroen van Ingen
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $hp = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
DestHost => 'myswitch',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $hp->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Provides abstraction to the configuration information obtainable from a
|
||||
HP VirtualConnect Switch via SNMP.
|
||||
|
||||
For speed or debugging purposes you can call the subclass directly, but not
|
||||
after determining a more specific class using the method above.
|
||||
|
||||
my $hp = new SNMP::Info::Layer2::HPVC(...);
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info::Layer2
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item F<HPVC-MIB>
|
||||
|
||||
=item F<CPQSINFO-MIB>
|
||||
|
||||
=item F<HPVCMODULE-MIB>
|
||||
|
||||
=back
|
||||
|
||||
All required MIBs can be found in the netdisco-mibs package.
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
These are methods that return scalar value from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $hp->os()
|
||||
|
||||
Returns hpvc
|
||||
|
||||
=item $hp->os_bin()
|
||||
|
||||
C<cpqHoFwVerVersion.1>
|
||||
|
||||
=item $hp->os_ver()
|
||||
|
||||
C<cpqHoSWRunningVersion.1>
|
||||
|
||||
=item $hp->serial()
|
||||
|
||||
C<cpqSiSysSerialNum.0>
|
||||
|
||||
=item $hp->vendor()
|
||||
|
||||
hp
|
||||
|
||||
=item $hp->model()
|
||||
|
||||
C<cpqSiProductName.0>
|
||||
|
||||
=back
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Layer2
|
||||
|
||||
See documentation in L<SNMP::Info::Layer2/"GLOBALS"> for details.
|
||||
|
||||
=head1 TABLE METHODS
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer2
|
||||
|
||||
See documentation in L<SNMP::Info::Layer2/"TABLE METHODS"> for details.
|
||||
|
||||
=head1 MUNGES
|
||||
|
||||
=over
|
||||
|
||||
=back
|
||||
|
||||
=head1 SET METHODS
|
||||
|
||||
These are methods that provide SNMP set functionality for overridden methods
|
||||
or provide a simpler interface to complex set operations. See
|
||||
L<SNMP::Info/"SETTING DATA VIA SNMP"> for general information on set
|
||||
operations.
|
||||
|
||||
=cut
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::Airespace;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS, %SNMP::Info::Bridge::MIBS,
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS, %SNMP::Info::IEEE802dot11::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer2::MIBS, );
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
# Set for No CDP
|
||||
%GLOBALS = ( %SNMP::Info::Layer2::GLOBALS );
|
||||
|
||||
@@ -40,19 +40,22 @@ use SNMP::Info::EtherLike;
|
||||
use SNMP::Info::Entity;
|
||||
use SNMP::Info::PowerEthernet;
|
||||
use SNMP::Info::IPv6;
|
||||
use SNMP::Info::AdslLine;
|
||||
|
||||
@SNMP::Info::Layer3::ISA = qw/
|
||||
SNMP::Info::PowerEthernet SNMP::Info::IPv6
|
||||
SNMP::Info::Entity SNMP::Info::EtherLike
|
||||
SNMP::Info::Bridge SNMP::Info Exporter/;
|
||||
SNMP::Info::Bridge SNMP::Info::AdslLine
|
||||
SNMP::Info Exporter/;
|
||||
@SNMP::Info::Layer3::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
%SNMP::Info::AdslLine::MIBS,
|
||||
%SNMP::Info::Bridge::MIBS,
|
||||
%SNMP::Info::EtherLike::MIBS,
|
||||
%SNMP::Info::Entity::MIBS,
|
||||
@@ -67,6 +70,7 @@ $VERSION = '2.05';
|
||||
|
||||
# Inherit the super class ones
|
||||
%SNMP::Info::GLOBALS,
|
||||
%SNMP::Info::AdslLine::GLOBALS,
|
||||
%SNMP::Info::Bridge::GLOBALS,
|
||||
%SNMP::Info::EtherLike::GLOBALS,
|
||||
%SNMP::Info::Entity::GLOBALS,
|
||||
@@ -82,6 +86,7 @@ $VERSION = '2.05';
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::FUNCS,
|
||||
%SNMP::Info::AdslLine::FUNCS,
|
||||
%SNMP::Info::Bridge::FUNCS,
|
||||
%SNMP::Info::EtherLike::FUNCS,
|
||||
%SNMP::Info::Entity::FUNCS,
|
||||
@@ -139,6 +144,7 @@ $VERSION = '2.05';
|
||||
|
||||
# Inherit all the built in munging
|
||||
%SNMP::Info::MUNGE,
|
||||
%SNMP::Info::AdslLine::MUNGE,
|
||||
%SNMP::Info::Bridge::MUNGE,
|
||||
%SNMP::Info::EtherLike::MUNGE,
|
||||
%SNMP::Info::Entity::MUNGE,
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::Layer3;
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE
|
||||
$int_include_vpn $fake_idx $type_class/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::Bridge;
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE %MODEL_MAP
|
||||
%MODID_MAP %PROCID_MAP/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
|
||||
@@ -64,7 +64,7 @@ use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
@SNMP::Info::Layer3::C3550::EXPORT_OK = qw//;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
# NOTE: Order creates precedence
|
||||
# Example: v_name exists in Bridge.pm and CiscoVTP.pm
|
||||
|
||||
@@ -50,7 +50,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -64,7 +64,7 @@ use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
# NOTE: Order creates precedence
|
||||
# Example: v_name exists in Bridge.pm and CiscoVTP.pm
|
||||
|
||||
@@ -52,7 +52,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::Layer3::Cisco;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::Cisco::MIBS,
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::Entity;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS, %SNMP::Info::Layer3::MIBS, %SNMP::Info::Entity::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -44,7 +44,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS, %SNMP::Info::CDP::MIBS,
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::MAU;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -44,7 +44,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer3::MIBS, );
|
||||
|
||||
|
||||
175
Info/Layer3/Mikrotik.pm
Normal file
175
Info/Layer3/Mikrotik.pm
Normal file
@@ -0,0 +1,175 @@
|
||||
# SNMP::Info::Layer3::Mikrotik
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2011 Jeroen van Ingen
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the University of California, Santa Cruz nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer3::Mikrotik;
|
||||
|
||||
use strict;
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer3;
|
||||
|
||||
@SNMP::Info::Layer3::Mikrotik::ISA = qw/SNMP::Info::Layer3 Exporter/;
|
||||
@SNMP::Info::Layer3::Mikrotik::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
'HOST-RESOURCES-MIB' => 'hrSystem',
|
||||
'MIKROTIK-MIB' => 'mtxrLicVersion',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
'hrSystemUptime' => 'hrSystemUptime',
|
||||
'os_ver' => 'mtxrLicVersion',
|
||||
);
|
||||
|
||||
%FUNCS = ( %SNMP::Info::Layer3::FUNCS, );
|
||||
|
||||
%MUNGE = ( %SNMP::Info::Layer3::MUNGE, );
|
||||
|
||||
sub vendor {
|
||||
return 'mikrotik';
|
||||
}
|
||||
|
||||
sub model {
|
||||
my $mikrotik = shift;
|
||||
my $descr = $mikrotik->description() || '';
|
||||
my $model = undef;
|
||||
$model = $1 if ( $descr =~ /^RouterOS\s+(\S+)$/i );
|
||||
return $model;
|
||||
}
|
||||
|
||||
sub os {
|
||||
return 'routeros';
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer3::Mikrotik - SNMP Interface to Mikrotik devices
|
||||
|
||||
=head1 AUTHORS
|
||||
|
||||
Jeroen van Ingen
|
||||
initial version based on SNMP::Info::Layer3::NetSNMP by Bradley Baetz and Bill Fenner
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $mikrotik = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
DestHost => 'myrouter',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $mikrotik->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Subclass for Mikrotik devices
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info::Layer3
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item F<HOST-RESOURCES-MIB>
|
||||
|
||||
=item F<MIKROTIK-MIB>
|
||||
|
||||
=item Inherited Classes' MIBs
|
||||
|
||||
See L<SNMP::Info::Layer3> for its own MIB requirements.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
These are methods that return scalar value from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $mikrotik->vendor()
|
||||
|
||||
Returns 'mikrotik'.
|
||||
|
||||
=item $mikrotik->os()
|
||||
|
||||
Returns 'routeros'.
|
||||
|
||||
=item $mikrotik->model()
|
||||
|
||||
Tries to extract the device model from C<sysDescr>.
|
||||
|
||||
=item $mikrotik->os_ver()
|
||||
|
||||
Returns the value of C<mtxrLicVersion>.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3> for details.
|
||||
|
||||
=head1 TABLE ENTRIES
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
None.
|
||||
|
||||
=over
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3> for details.
|
||||
|
||||
|
||||
=cut
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::SONMP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
220
Info/Layer3/PacketFront.pm
Normal file
220
Info/Layer3/PacketFront.pm
Normal file
@@ -0,0 +1,220 @@
|
||||
# SNMP::Info::Layer3::PacketFront
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2011 Jeroen van Ingen
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the University of California, Santa Cruz nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer3::PacketFront;
|
||||
|
||||
use strict;
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer3;
|
||||
|
||||
@SNMP::Info::Layer3::PacketFront::ISA = qw/SNMP::Info::Layer3 Exporter/;
|
||||
@SNMP::Info::Layer3::PacketFront::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
'UCD-SNMP-MIB' => 'versionTag',
|
||||
'NET-SNMP-TC' => 'netSnmpAgentOIDs',
|
||||
'HOST-RESOURCES-MIB' => 'hrSystem',
|
||||
'PACKETFRONT-PRODUCTS-MIB' => 'drg100',
|
||||
'PACKETFRONT-DRG-MIB' => 'productName',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
'snmpd_vers' => 'versionTag',
|
||||
'hrSystemUptime' => 'hrSystemUptime',
|
||||
);
|
||||
|
||||
%FUNCS = ( %SNMP::Info::Layer3::FUNCS, );
|
||||
|
||||
%MUNGE = ( %SNMP::Info::Layer3::MUNGE, );
|
||||
|
||||
sub vendor {
|
||||
return 'packetfront';
|
||||
}
|
||||
|
||||
sub os {
|
||||
# Only DRGOS for now (not tested with other product lines than DRG series)
|
||||
my $pfront = shift;
|
||||
my $descr = $pfront->description();
|
||||
if ( $descr =~ /drgos/i ) {
|
||||
return 'drgos';
|
||||
} else {
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
sub os_ver {
|
||||
my $pfront = shift;
|
||||
my $descr = $pfront->description();
|
||||
my $os_ver = undef;
|
||||
|
||||
if ( $descr =~ /Version:\sdrgos-(\w+)-([\w\-\.]+)/ ) {
|
||||
$os_ver = $2;
|
||||
}
|
||||
return $os_ver;
|
||||
}
|
||||
|
||||
sub serial {
|
||||
my $pfront = shift;
|
||||
return $pfront->productSerialNo();
|
||||
}
|
||||
|
||||
sub i_ignore {
|
||||
my $l3 = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $interfaces = $l3->interfaces($partial) || {};
|
||||
|
||||
my %i_ignore;
|
||||
foreach my $if ( keys %$interfaces ) {
|
||||
|
||||
# lo0 etc
|
||||
if ( $interfaces->{$if} =~ /\blo\d*\b/i ) {
|
||||
$i_ignore{$if}++;
|
||||
}
|
||||
}
|
||||
return \%i_ignore;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer3::PacketFront - SNMP Interface to PacketFront devices
|
||||
|
||||
=head1 AUTHORS
|
||||
|
||||
Jeroen van Ingen
|
||||
initial version based on SNMP::Info::Layer3::NetSNMP by Bradley Baetz and Bill Fenner
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $pfront = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
DestHost => 'myrouter',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $pfront->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Subclass for PacketFront devices
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info::Layer3
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item F<UCD-SNMP-MIB>
|
||||
|
||||
=item F<NET-SNMP-TC>
|
||||
|
||||
=item F<HOST-RESOURCES-MIB>
|
||||
|
||||
=item F<PACKETFRONT-PRODUCTS-MIB>
|
||||
|
||||
=item F<PACKETFRONT-DRG-MIB>
|
||||
|
||||
=item Inherited Classes' MIBs
|
||||
|
||||
See L<SNMP::Info::Layer3> for its own MIB requirements.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
These are methods that return scalar value from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $pfront->vendor()
|
||||
|
||||
Returns 'packetfront'.
|
||||
|
||||
=item $pfront->os()
|
||||
|
||||
Returns the OS extracted from C<sysDescr>.
|
||||
|
||||
=item $pfront->os_ver()
|
||||
|
||||
Returns the software version extracted from C<sysDescr>.
|
||||
|
||||
=item $pfront->serial()
|
||||
|
||||
Returns the value of productSerialNo.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3> for details.
|
||||
|
||||
=head1 TABLE ENTRIES
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=item $pfront->i_ignore()
|
||||
|
||||
Returns reference to hash. Increments value of IID if port is to be ignored.
|
||||
|
||||
Ignores loopback
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3> for details.
|
||||
|
||||
|
||||
=cut
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS, %SNMP::Info::RapidCity::MIBS,
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer3::MIBS, );
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer3::MIBS, 'TIMETRA-GLOBAL-MIB' => 'timetraReg', );
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = ( 'MAU-MIB' => 'mauMod' );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = ( 'POWER-ETHERNET-MIB' => 'pethPsePortDetectionStatus' );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = ( 'RAPID-CITY' => 'rapidCity', );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
$VERSION = '2.06';
|
||||
|
||||
%MIBS = (
|
||||
'SYNOPTICS-ROOT-MIB' => 'synoptics',
|
||||
|
||||
4
MANIFEST
4
MANIFEST
@@ -3,6 +3,7 @@ COPYRIGHT
|
||||
DEVELOP
|
||||
DeviceMatrix.txt
|
||||
Info.pm
|
||||
Info/AdslLine.pm
|
||||
Info/Airespace.pm
|
||||
Info/Bridge.pm
|
||||
Info/CDP.pm
|
||||
@@ -41,6 +42,7 @@ Info/Layer2/Cisco.pm
|
||||
Info/Layer2/Foundry.pm
|
||||
Info/Layer2/HP.pm
|
||||
Info/Layer2/HP4000.pm
|
||||
Info/Layer2/HPVC.pm
|
||||
Info/Layer2/N2270.pm
|
||||
Info/Layer2/NAP222x.pm
|
||||
Info/Layer2/Netgear.pm
|
||||
@@ -67,9 +69,11 @@ Info/Layer3/Foundry.pm
|
||||
Info/Layer3/HP9300.pm
|
||||
Info/Layer3/Juniper.pm
|
||||
Info/Layer3/Microsoft.pm
|
||||
Info/Layer3/Mikrotik.pm
|
||||
Info/Layer3/N1600.pm
|
||||
Info/Layer3/Netscreen.pm
|
||||
Info/Layer3/NetSNMP.pm
|
||||
Info/Layer3/PacketFront.pm
|
||||
Info/Layer3/Passport.pm
|
||||
Info/Layer3/Pf.pm
|
||||
Info/Layer3/Sun.pm
|
||||
|
||||
31
README
31
README
@@ -5,7 +5,7 @@ NAME
|
||||
|
||||
VERSION
|
||||
|
||||
SNMP::Info - Version 2.05
|
||||
SNMP::Info - Version 2.06
|
||||
|
||||
AUTHOR
|
||||
|
||||
@@ -194,6 +194,13 @@ SUBCLASSES
|
||||
|
||||
For more info run "perldoc" on any of the following module names.
|
||||
|
||||
SNMP::Info::AdslLine
|
||||
SNMP Interface to the ADSL-LINE-MIB for ADSL interfaces.
|
||||
|
||||
Requires the ADSL-LINE-MIB, downloadable from Cisco.
|
||||
|
||||
See documentation in SNMP::Info::AdslLine for details.
|
||||
|
||||
SNMP::Info::Airespace
|
||||
AIRESPACE-WIRELESS-MIB and AIRESPACE-SWITCHING-MIB. Inherited by
|
||||
devices based on the Airespace wireless platform.
|
||||
@@ -457,6 +464,11 @@ SUBCLASSES
|
||||
|
||||
See documentation in SNMP::Info::Layer2::HP4000 for details.
|
||||
|
||||
SNMP::Info::Layer2::HPVC
|
||||
Subclass for HP VirtualConnect Switches
|
||||
|
||||
See documentation in SNMP::Info::Layer2::HPVC for details.
|
||||
|
||||
SNMP::Info::Layer2::N2270
|
||||
Subclass for Nortel 2270 wireless switches.
|
||||
|
||||
@@ -601,6 +613,11 @@ SUBCLASSES
|
||||
|
||||
See documentation in SNMP::Info::Layer3::Microsoft for details.
|
||||
|
||||
SNMP::Info::Layer3::Mikrotik
|
||||
Subclass for Mikrotik devices running RouterOS.
|
||||
|
||||
See documentation in SNMP::Info::Layer3::Mikrotik for details.
|
||||
|
||||
SNMP::Info::Layer3::N1600
|
||||
Subclass for Nortel Ethernet Routing Switch 1600 series.
|
||||
|
||||
@@ -616,6 +633,12 @@ SUBCLASSES
|
||||
|
||||
See documentation in SNMP::Info::Layer3::Netscreen for details.
|
||||
|
||||
SNMP::Info::Layer3::PacketFront
|
||||
Subclass for PacketFront DRG series CPE.
|
||||
|
||||
See documentation in SNMP::Info::Layer3::PacketFront for
|
||||
details.
|
||||
|
||||
SNMP::Info::Layer3::Passport
|
||||
Subclass for Nortel Ethernet Routing Switch/Passport 8000 series
|
||||
and Accelar series switches.
|
||||
@@ -1538,6 +1561,12 @@ SNMP::INFO INTERNALS
|
||||
'2488000000' => 'OC-48',
|
||||
)
|
||||
|
||||
Note: high speed interfaces (usually 1 Gbps or faster) have their
|
||||
link speed in "ifHighSpeed". i_speed() automatically determines
|
||||
whether to use "ifSpeed" or "ifHighSpeed"; if the latter is used,
|
||||
the value is munged by munge_highspeed(). SNMP::Info can return
|
||||
speeds up to terabit levels this way.
|
||||
|
||||
munge_highspeed()
|
||||
Makes human friendly speed ratings for "ifHighSpeed"
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ use File::Glob qw/bsd_glob/;
|
||||
|
||||
my @pms = glob_rec("../Info");
|
||||
|
||||
$new_version = shift @ARGV || '2.05';
|
||||
$new_version = shift @ARGV || '2.06';
|
||||
|
||||
foreach my $p (@pms) {
|
||||
print "$p\n";
|
||||
|
||||
@@ -82,9 +82,10 @@ print "Detected Class: ", $dev->device_type(), "\n";
|
||||
print "Using Class: $Class (-c to change)\n";
|
||||
|
||||
my $layers = $dev->layers();
|
||||
my $descr = $dev->description();
|
||||
|
||||
unless (defined $layers){
|
||||
die "Are you sure you got the right community string and version?\nCan't fetch layers.\n";
|
||||
unless (defined $layers or defined $descr){
|
||||
die "Are you sure you got the right community string and version?\nCan't fetch layers or description.\n";
|
||||
}
|
||||
|
||||
print "Fetching global info...\n\n";
|
||||
|
||||
Reference in New Issue
Block a user