brought this thing back to life
This commit is contained in:
@@ -30,25 +30,25 @@
|
|||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
package SNMP::Info::Layer3::Foundry;
|
package SNMP::Info::Layer3::Foundry;
|
||||||
$VERSION = 1.0;
|
|
||||||
# $Id$
|
# $Id$
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
use Exporter;
|
use Exporter;
|
||||||
use SNMP::Info;
|
use SNMP::Info::Layer3;
|
||||||
use SNMP::Info::Bridge;
|
|
||||||
use SNMP::Info::FDP;
|
use SNMP::Info::FDP;
|
||||||
|
|
||||||
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
|
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
|
||||||
|
|
||||||
@SNMP::Info::Layer3::Foundry::ISA = qw/SNMP::Info SNMP::Info::Bridge SNMP::Info::FDP Exporter/;
|
$VERSION = 1.0;
|
||||||
|
|
||||||
|
@SNMP::Info::Layer3::Foundry::ISA = qw/SNMP::Info::Layer3 SNMP::Info::FDP Exporter/;
|
||||||
@SNMP::Info::Layer3::Foundry::EXPORT_OK = qw//;
|
@SNMP::Info::Layer3::Foundry::EXPORT_OK = qw//;
|
||||||
|
|
||||||
%MIBS = ( %SNMP::Info::MIBS,
|
%MIBS = ( %SNMP::Info::Layer3::MIBS,
|
||||||
%SNMP::Info::Bridge::MIBS,
|
|
||||||
%SNMP::Info::FDP::MIBS,
|
%SNMP::Info::FDP::MIBS,
|
||||||
'FOUNDRY-SN-ROOT-MIB' => 'foundry',
|
'FOUNDRY-SN-ROOT-MIB' => 'foundry',
|
||||||
|
'FOUNDRY-SN-AGENT-MIB' => 'snChasPwrSupplyDescription',
|
||||||
# IP-FORWARD-MIB
|
# IP-FORWARD-MIB
|
||||||
# ETHERLIKE-MIB
|
# ETHERLIKE-MIB
|
||||||
# RFC1398-MIB
|
# RFC1398-MIB
|
||||||
@@ -57,9 +57,7 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
|
|||||||
);
|
);
|
||||||
|
|
||||||
%GLOBALS = (
|
%GLOBALS = (
|
||||||
# Inherit the super class ones
|
%SNMP::Info::Layer3::GLOBALS,
|
||||||
%SNMP::Info::GLOBALS,
|
|
||||||
%SNMP::Info::Bridge::GLOBALS,
|
|
||||||
%SNMP::Info::FDP::GLOBALS,
|
%SNMP::Info::FDP::GLOBALS,
|
||||||
'mac' => 'ifPhysAddress.1',
|
'mac' => 'ifPhysAddress.1',
|
||||||
'chassis' => 'entPhysicalDescr.1',
|
'chassis' => 'entPhysicalDescr.1',
|
||||||
@@ -76,14 +74,9 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
|
|||||||
);
|
);
|
||||||
|
|
||||||
%FUNCS = (
|
%FUNCS = (
|
||||||
%SNMP::Info::FUNCS,
|
%SNMP::Info::Layer3::FUNCS,
|
||||||
%SNMP::Info::Bridge::FUNCS,
|
|
||||||
%SNMP::Info::FDP::FUNCS,
|
%SNMP::Info::FDP::FUNCS,
|
||||||
'i_name2' => 'ifName',
|
'i_name2' => 'ifName',
|
||||||
# From RFC1213-MIB
|
|
||||||
'at_index' => 'ipNetToMediaIfIndex',
|
|
||||||
'at_paddr' => 'ipNetToMediaPhysAddress',
|
|
||||||
'at_netaddr' => 'ipNetToMediaNetAddress',
|
|
||||||
# FOUNDRY-MIB
|
# FOUNDRY-MIB
|
||||||
# snSwPortInfoTable - Switch Port Information Group
|
# snSwPortInfoTable - Switch Port Information Group
|
||||||
'sw_index' => 'snSwPortIfIndex',
|
'sw_index' => 'snSwPortIfIndex',
|
||||||
@@ -94,8 +87,7 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
|
|||||||
|
|
||||||
%MUNGE = (
|
%MUNGE = (
|
||||||
# Inherit all the built in munging
|
# Inherit all the built in munging
|
||||||
%SNMP::Info::MUNGE,
|
%SNMP::Info::Layer3::MUNGE,
|
||||||
%SNMP::Info::Bridge::MUNGE,
|
|
||||||
%SNMP::Info::FDP::MUNGE,
|
%SNMP::Info::FDP::MUNGE,
|
||||||
'at_paddr' => \&SNMP::Info::munge_mac,
|
'at_paddr' => \&SNMP::Info::munge_mac,
|
||||||
);
|
);
|
||||||
@@ -103,6 +95,8 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
|
|||||||
|
|
||||||
# Method OverRides
|
# Method OverRides
|
||||||
|
|
||||||
|
sub bulkwalk_no { 1; }
|
||||||
|
|
||||||
# Add our i_aliases if they are set (manually)
|
# Add our i_aliases if they are set (manually)
|
||||||
sub i_name {
|
sub i_name {
|
||||||
my $foundry = shift;
|
my $foundry = shift;
|
||||||
@@ -140,6 +134,10 @@ sub i_duplex {
|
|||||||
my $foundry = shift;
|
my $foundry = shift;
|
||||||
my $sw_index = $foundry->sw_index();
|
my $sw_index = $foundry->sw_index();
|
||||||
my $sw_duplex= $foundry->sw_duplex();
|
my $sw_duplex= $foundry->sw_duplex();
|
||||||
|
|
||||||
|
unless (defined $sw_index and defined $sw_duplex){
|
||||||
|
return $foundry->SUPER::i_duplex();
|
||||||
|
}
|
||||||
|
|
||||||
my %i_duplex;
|
my %i_duplex;
|
||||||
foreach my $sw_port (keys %$sw_duplex){
|
foreach my $sw_port (keys %$sw_duplex){
|
||||||
@@ -156,6 +154,10 @@ sub i_type {
|
|||||||
my $foundry = shift;
|
my $foundry = shift;
|
||||||
my $sw_index = $foundry->sw_index();
|
my $sw_index = $foundry->sw_index();
|
||||||
my $sw_type= $foundry->sw_type();
|
my $sw_type= $foundry->sw_type();
|
||||||
|
|
||||||
|
unless (defined $sw_index and defined $sw_type){
|
||||||
|
return $foundry->SUPER::i_type();
|
||||||
|
}
|
||||||
|
|
||||||
my %i_type;
|
my %i_type;
|
||||||
foreach my $sw_port (keys %$sw_type){
|
foreach my $sw_port (keys %$sw_type){
|
||||||
@@ -171,6 +173,10 @@ sub i_speed {
|
|||||||
my $foundry = shift;
|
my $foundry = shift;
|
||||||
my $sw_index = $foundry->sw_index();
|
my $sw_index = $foundry->sw_index();
|
||||||
my $sw_speed= $foundry->sw_speed();
|
my $sw_speed= $foundry->sw_speed();
|
||||||
|
|
||||||
|
unless (defined $sw_index and defined $sw_speed){
|
||||||
|
return $foundry->SUPER::i_speed();
|
||||||
|
}
|
||||||
|
|
||||||
my %i_speed;
|
my %i_speed;
|
||||||
foreach my $sw_port (keys %$sw_speed){
|
foreach my $sw_port (keys %$sw_speed){
|
||||||
@@ -196,6 +202,7 @@ sub model {
|
|||||||
my $model = &SNMP::translateObj($id);
|
my $model = &SNMP::translateObj($id);
|
||||||
|
|
||||||
$model = $1 if $desc =~ /\s+([a-z]{2}\d{4})\D/i;
|
$model = $1 if $desc =~ /\s+([a-z]{2}\d{4})\D/i;
|
||||||
|
$model = $1 if $desc =~ /\b(FW[A-Z\d]+)/;
|
||||||
|
|
||||||
|
|
||||||
return $model;
|
return $model;
|
||||||
@@ -241,6 +248,7 @@ sub interfaces {
|
|||||||
sub vendor {
|
sub vendor {
|
||||||
return 'foundry';
|
return 'foundry';
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
__END__
|
__END__
|
||||||
|
|
||||||
@@ -266,15 +274,14 @@ Max Baker
|
|||||||
or die "Can't connect to DestHost.\n";
|
or die "Can't connect to DestHost.\n";
|
||||||
|
|
||||||
my $class = $foundry->class();
|
my $class = $foundry->class();
|
||||||
|
|
||||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
This subclass no longer supported.
|
This module provides limited functionality from some L2+L3 and L3 Foundry devices.
|
||||||
|
|
||||||
This module provides limited functionality from older Foundry devices.
|
Specifically designed for a FI4802. Works on a FWSX424.
|
||||||
|
|
||||||
Specifically designed for a FI4802.
|
|
||||||
|
|
||||||
For speed or debugging purposes you can call the subclass directly, but not after determining
|
For speed or debugging purposes you can call the subclass directly, but not after determining
|
||||||
a more specific class using the method above. Turn off the AutoSpecify flag.
|
a more specific class using the method above. Turn off the AutoSpecify flag.
|
||||||
@@ -287,7 +294,6 @@ a more specific class using the method above. Turn off the AutoSpecify flag.
|
|||||||
|
|
||||||
=item SNMP::Info
|
=item SNMP::Info
|
||||||
|
|
||||||
=item SNMP::Info::Bridge
|
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
@@ -368,10 +374,6 @@ Returns the status of the chassis fan.
|
|||||||
|
|
||||||
See documentation in SNMP::Info for details.
|
See documentation in SNMP::Info for details.
|
||||||
|
|
||||||
=head2 Globals imported from SNMP::Info::Bridge
|
|
||||||
|
|
||||||
See documentation in SNMP::Info::Bridge for details.
|
|
||||||
|
|
||||||
=head1 TABLE ENTRIES
|
=head1 TABLE ENTRIES
|
||||||
|
|
||||||
These are methods that return tables of information in the form of a reference
|
These are methods that return tables of information in the form of a reference
|
||||||
@@ -477,8 +479,4 @@ Returns reference to hash. Current Port Speed.
|
|||||||
|
|
||||||
See documentation in SNMP::Info for details.
|
See documentation in SNMP::Info for details.
|
||||||
|
|
||||||
=head2 Table Methods imported from SNMP::Info::Bridge
|
|
||||||
|
|
||||||
See documentation in SNMP::Info::Bridge for details.
|
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|||||||
Reference in New Issue
Block a user