perltidy
This commit is contained in:
@@ -51,7 +51,8 @@ $VERSION = '1.09';
|
||||
'ALCATEL-IND1-DEVICES' => 'familyOmniSwitch7000',
|
||||
'ALCATEL-IND1-CHASSIS-MIB' => 'chasEntPhysOperStatus',
|
||||
'ALU-POWER-ETHERNET-MIB' => 'pethPsePortDetectionStatus',
|
||||
);
|
||||
);
|
||||
|
||||
# Alcatel provides their own version of the POWER-ETHERNET-MIB,
|
||||
# off in vendor-space, without renaming any of the objects.
|
||||
# This means we have to *not* load the POWER-ETHERNET-MIB
|
||||
@@ -62,26 +63,25 @@ $VERSION = '1.09';
|
||||
delete $MIBS{'POWER-ETHERNET-MIB'};
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
%SNMP::Info::MAU::GLOBALS,
|
||||
%SNMP::Info::Layer3::GLOBALS, %SNMP::Info::MAU::GLOBALS,
|
||||
%SNMP::Info::LLDP::GLOBALS,
|
||||
);
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
%SNMP::Info::MAU::FUNCS,
|
||||
%SNMP::Info::Layer3::FUNCS, %SNMP::Info::MAU::FUNCS,
|
||||
%SNMP::Info::LLDP::FUNCS,
|
||||
);
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
%SNMP::Info::MAU::MUNGE,
|
||||
%SNMP::Info::Layer3::MUNGE, %SNMP::Info::MAU::MUNGE,
|
||||
%SNMP::Info::LLDP::MUNGE,
|
||||
);
|
||||
);
|
||||
|
||||
# use MAU-MIB for admin. duplex and admin. speed
|
||||
*SNMP::Info::Layer3::AlcatelLucent::i_duplex_admin = \&SNMP::Info::MAU::mau_i_duplex_admin;
|
||||
*SNMP::Info::Layer3::AlcatelLucent::i_speed_admin = \&SNMP::Info::MAU::mau_i_speed_admin;
|
||||
*SNMP::Info::Layer3::AlcatelLucent::i_duplex_admin
|
||||
= \&SNMP::Info::MAU::mau_i_duplex_admin;
|
||||
*SNMP::Info::Layer3::AlcatelLucent::i_speed_admin
|
||||
= \&SNMP::Info::MAU::mau_i_speed_admin;
|
||||
|
||||
sub model {
|
||||
my $alu = shift;
|
||||
@@ -107,7 +107,7 @@ sub os_ver {
|
||||
my $alu = shift;
|
||||
|
||||
my $descr = $alu->description();
|
||||
if ($descr =~ m/^(\S+)/) {
|
||||
if ( $descr =~ m/^(\S+)/ ) {
|
||||
return $1;
|
||||
}
|
||||
|
||||
@@ -126,9 +126,9 @@ sub _power_supplies {
|
||||
my $e_class = $alu->e_class();
|
||||
my @supplies = ();
|
||||
|
||||
foreach my $key (sort { int($a) cmp int($b) } keys %$e_class) {
|
||||
foreach my $key ( sort { int($a) cmp int($b) } keys %$e_class ) {
|
||||
if ( $e_class->{$key} eq 'powerSupply' ) {
|
||||
push( @supplies, int( $key ) );
|
||||
push( @supplies, int($key) );
|
||||
}
|
||||
}
|
||||
return @supplies;
|
||||
@@ -139,11 +139,11 @@ sub _ps_type {
|
||||
my $psnum = shift;
|
||||
my @ps = $alu->_power_supplies();
|
||||
|
||||
if ($psnum > $#ps) {
|
||||
if ( $psnum > $#ps ) {
|
||||
return "none";
|
||||
}
|
||||
my $supply = $ps[$psnum];
|
||||
my $descr = $alu->e_descr( $supply );
|
||||
my $descr = $alu->e_descr($supply);
|
||||
return $descr->{$supply};
|
||||
}
|
||||
|
||||
@@ -152,32 +152,32 @@ sub _ps_status {
|
||||
my $psnum = shift;
|
||||
my @ps = $alu->_power_supplies();
|
||||
|
||||
if ($psnum > $#ps) {
|
||||
if ( $psnum > $#ps ) {
|
||||
return "not present";
|
||||
}
|
||||
my $supply = $ps[$psnum];
|
||||
my $status = $alu->chasEntPhysOperStatus( $supply );
|
||||
my $status = $alu->chasEntPhysOperStatus($supply);
|
||||
return $status->{$supply};
|
||||
}
|
||||
|
||||
sub ps1_type {
|
||||
my $alu = shift;
|
||||
return $alu->_ps_type( 0 );
|
||||
return $alu->_ps_type(0);
|
||||
}
|
||||
|
||||
sub ps2_type {
|
||||
my $alu = shift;
|
||||
return $alu->_ps_type( 1 );
|
||||
return $alu->_ps_type(1);
|
||||
}
|
||||
|
||||
sub ps1_status {
|
||||
my $alu = shift;
|
||||
return $alu->_ps_status( 0 );
|
||||
return $alu->_ps_status(0);
|
||||
}
|
||||
|
||||
sub ps2_status {
|
||||
my $alu = shift;
|
||||
return $alu->_ps_status( 1 );
|
||||
return $alu->_ps_status(1);
|
||||
}
|
||||
|
||||
# The interface description contains the software version, so
|
||||
@@ -211,6 +211,7 @@ sub bp_index {
|
||||
my $partial = shift;
|
||||
|
||||
my $bp_index = $alu->SUPER::bp_index($partial);
|
||||
|
||||
#
|
||||
# This device sometimes reports an ifIndex and sometimes reports
|
||||
# dot1dBasePort for the dot1d port values - e.g.,
|
||||
@@ -222,22 +223,24 @@ sub bp_index {
|
||||
# the ifIndex and dot1dBasePort spaces don't overlap, at least for
|
||||
# the ports we care about.
|
||||
my @keys = keys %$bp_index;
|
||||
foreach my $idx (@keys){
|
||||
foreach my $idx (@keys) {
|
||||
my $ifIndex = $bp_index->{$idx};
|
||||
$bp_index->{$ifIndex} = $ifIndex;
|
||||
}
|
||||
|
||||
#
|
||||
# In addition, aggregates aren't reported at all in bp_index.
|
||||
# We grab them from i_index.
|
||||
my $i_index = $alu->i_index();
|
||||
foreach my $idx (keys %$i_index) {
|
||||
foreach my $idx ( keys %$i_index ) {
|
||||
my $ifIndex = $i_index->{$idx};
|
||||
if (int($ifIndex) > 40000001) {
|
||||
if ( int($ifIndex) > 40000001 ) {
|
||||
$bp_index->{$ifIndex} = $ifIndex;
|
||||
|
||||
# dot1dTpFdbPort seems to use 4098, 4099, 4100 for
|
||||
# 40000001, 40000002, 40000003. I guess this is
|
||||
# 4096 + 1 + aggregate number.
|
||||
my $tmp = sprintf("%d", int($ifIndex) - 39995903);
|
||||
my $tmp = sprintf( "%d", int($ifIndex) - 39995903 );
|
||||
$bp_index->{$tmp} = $ifIndex;
|
||||
}
|
||||
}
|
||||
@@ -339,9 +342,9 @@ sub peth_port_ifindex {
|
||||
my $peth_port_status = $alu->peth_port_status($partial);
|
||||
my $peth_port_ifindex = {};
|
||||
|
||||
foreach my $key (keys %$peth_port_status) {
|
||||
foreach my $key ( keys %$peth_port_status ) {
|
||||
my @oid = split( m/\./, $key );
|
||||
$peth_port_ifindex->{$key} = int($oid[0]) * 1000 + int($oid[1]);
|
||||
$peth_port_ifindex->{$key} = int( $oid[0] ) * 1000 + int( $oid[1] );
|
||||
}
|
||||
return $peth_port_ifindex;
|
||||
}
|
||||
|
||||
@@ -42,22 +42,13 @@ use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '1.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
'TIMETRA-GLOBAL-MIB' => 'timetraReg',
|
||||
);
|
||||
%MIBS = ( %SNMP::Info::Layer3::MIBS, 'TIMETRA-GLOBAL-MIB' => 'timetraReg', );
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
);
|
||||
%GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, );
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
);
|
||||
%FUNCS = ( %SNMP::Info::Layer3::FUNCS, );
|
||||
|
||||
%MUNGE = (
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
);
|
||||
%MUNGE = ( %SNMP::Info::Layer3::MUNGE, );
|
||||
|
||||
sub model {
|
||||
my $timetra = shift;
|
||||
@@ -83,7 +74,7 @@ sub os_ver {
|
||||
my $timetra = shift;
|
||||
|
||||
my $descr = $timetra->description();
|
||||
if ($descr =~ m/^TiMOS-(\S+)/) {
|
||||
if ( $descr =~ m/^TiMOS-(\S+)/ ) {
|
||||
return $1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user