Merge branch 'master' of ssh://snmp-info.git.sourceforge.net/gitroot/snmp-info/snmp-info

This commit is contained in:
Jeroen van Ingen
2012-06-28 13:07:44 +02:00
4 changed files with 97 additions and 62 deletions

View File

@@ -11,6 +11,8 @@ version 2.07 ()
[ENHANCEMENTS] [ENHANCEMENTS]
* Add method to report current transmit power of the radio interface,
dot11_cur_tx_pwr_mw(), in Airespace class
* [3085411] Activate L3 properties for Netgear GSM7224v2 (phishphreek) * [3085411] Activate L3 properties for Netgear GSM7224v2 (phishphreek)
* [3085413] SNMP OIDs for Netgear Serial and OS Ver (phishphreek) * [3085413] SNMP OIDs for Netgear Serial and OS Ver (phishphreek)
* [3286549] Dell LLDP Support (Nico Giefing) * [3286549] Dell LLDP Support (Nico Giefing)
@@ -21,8 +23,10 @@ version 2.07 ()
[BUG FIXES] [BUG FIXES]
* Correct reporting of SSID broadcast status in Airespace class
* [2929883] [3413999] LLDP interface mapping issue
* [3297786] LLDP TimeMark component defaults to zero (David Baldwin)
* [2988163] Detect Juniper SSG firewalls as Layer3::Netscreen (R. Kerr) * [2988163] Detect Juniper SSG firewalls as Layer3::Netscreen (R. Kerr)
* [3297786] LLDP INDEX munged to ignore TimeMark component (David Baldwin)
* [3317739] Fix for Baystack without POE on stack member 1 (David Baldwin) * [3317739] Fix for Baystack without POE on stack member 1 (David Baldwin)
* [2037444] os_ver fails on some Extreme versions (Robert Kerr) * [2037444] os_ver fails on some Extreme versions (Robert Kerr)
* [2980789] Fix root_ip to try OSPF RouterID first (Brian De Wolf) * [2980789] Fix root_ip to try OSPF RouterID first (Brian De Wolf)

View File

@@ -83,6 +83,7 @@ $VERSION = '2.06';
'airespace_ess_qos' => 'bsnDot11EssQualityOfService', 'airespace_ess_qos' => 'bsnDot11EssQualityOfService',
'airespace_ess_ifname' => 'bsnDot11EssInterfaceName', 'airespace_ess_ifname' => 'bsnDot11EssInterfaceName',
'airespace_ess_aclname' => 'bsnDot11EssAclName', 'airespace_ess_aclname' => 'bsnDot11EssAclName',
'airespace_ess_bcast' => 'bsnDot11EssBroadcastSsid',
# AIRESPACE-WIRELESS-MIB::bsnAPTable # AIRESPACE-WIRELESS-MIB::bsnAPTable
'airespace_ap_mac' => 'bsnAPDot3MacAddress', 'airespace_ap_mac' => 'bsnAPDot3MacAddress',
@@ -105,6 +106,7 @@ $VERSION = '2.06';
'airespace_apif' => 'bsnAPIfOperStatus', 'airespace_apif' => 'bsnAPIfOperStatus',
'airespace_apif_oride' => 'bsnAPIfWlanOverride', 'airespace_apif_oride' => 'bsnAPIfWlanOverride',
'airespace_apif_admin' => 'bsnAPIfAdminStatus', 'airespace_apif_admin' => 'bsnAPIfAdminStatus',
'airespace_apif_a_pwr' => 'bsnAPIfAbsolutePowerList',
# AIRESPACE-WIRELESS-MIB::bsnMobileStationTable # AIRESPACE-WIRELESS-MIB::bsnMobileStationTable
'airespace_sta_mac' => 'bsnMobileStationAPMacAddr', 'airespace_sta_mac' => 'bsnMobileStationAPMacAddr',
@@ -631,15 +633,27 @@ sub i_ssidbcast {
my $airespace = shift; my $airespace = shift;
my $partial = shift; my $partial = shift;
my $ssidlist = $airespace->i_ssidlist($partial) || {}; my $ssidlist = $airespace->i_ssidlist($partial) || {};
my $bc_mode = $airespace->airespace_bssid_mode() || 'enable'; my $bc_mode = $airespace->airespace_bssid_mode() || 'enable';
my $ess_bc_mode = $airespace->airespace_ess_bcast() || {};
my $ssids = $airespace->airespace_ess_ssid() || {};
my %ssid_index = reverse %$ssids;
my %bcmap = qw/enable 1 disable 0/; my %bcmap = qw/enable 1 disable 0/;
my $broadcast = $bcmap{$bc_mode}; my $broadcast = $bcmap{$bc_mode};
my %i_ssidbcast; my %i_ssidbcast;
foreach my $iid ( keys %$ssidlist ) { foreach my $iid ( keys %$ssidlist ) {
$i_ssidbcast{$iid} = $broadcast; if (!$broadcast) {
$i_ssidbcast{$iid} = $broadcast;
next;
}
else {
my $ssid = $ssidlist->{$iid};
my $ssid_idx = $ssid_index{$ssid};
my $bc = $ess_bc_mode->{$ssid_idx};
$i_ssidbcast{$iid} = $bcmap{$bc};
}
} }
return \%i_ssidbcast; return \%i_ssidbcast;
@@ -661,6 +675,28 @@ sub i_80211channel {
return \%i_80211channel; return \%i_80211channel;
} }
sub dot11_cur_tx_pwr_mw {
my $airespace = shift;
my $partial = shift;
my $cur = $airespace->airespace_apif_power($partial);
my $pwr_abs = $airespace->airespace_apif_a_pwr($partial);
my $dot11_cur_tx_pwr_mw = {};
foreach my $idx ( keys %$cur ) {
my $pwr = $cur->{$idx};
if ( $pwr >= 1 && $pwr <= 8 ) {
my @pwr_list = split(/,/, $pwr_abs->{$idx} );
$dot11_cur_tx_pwr_mw->{$idx} = $pwr_list[$pwr-1];
}
else {
next;
}
}
return $dot11_cur_tx_pwr_mw;
}
# Pseudo ENTITY-MIB methods # Pseudo ENTITY-MIB methods
sub e_index { sub e_index {
@@ -1147,6 +1183,11 @@ Returns reference to hash. Indicates whether the SSID is broadcast.
Returns reference to hash. Current operating frequency channel of the radio Returns reference to hash. Current operating frequency channel of the radio
interface. interface.
=item $dot11->dot11_cur_tx_pwr_mw()
Returns reference to hash. Current transmit power, in milliwatts, of the
radio interface.
=back =back
=head2 Dot11 Ess Table (C<bsnDot11EssTable>) =head2 Dot11 Ess Table (C<bsnDot11EssTable>)
@@ -1214,6 +1255,12 @@ enabled.
(C<bsnDot11EssAclName>) (C<bsnDot11EssAclName>)
=item $airespace->airespace_ess_bcast()
This attribute when enabled allows the switch to broadcast this SSID.
(C<bsnDot11EssBroadcastSsid>)
=back =back
=head2 AP Table (C<bsnAPTable>) =head2 AP Table (C<bsnAPTable>)
@@ -1317,6 +1364,12 @@ However, if this is enabled, then only those WLANs that appear in the
(C<bsnAPIfAdminStatus>) (C<bsnAPIfAdminStatus>)
=item $airespace->airespace_apif_a_pwr()
List of comma separated absolute power levels supported by the radio.
(C<bsnAPIfAbsolutePowerList>)
=back =back
=head2 Mobile Station Table (C<bsnMobileStationTable>) =head2 Mobile Station Table (C<bsnMobileStationTable>)

View File

@@ -166,12 +166,6 @@ sub fw_port {
} }
# Use CDP and/or LLDP # Use CDP and/or LLDP
#
# LLDP table timefilter implementation continuously increments when walked
# and we may never reach the end of the table. This behavior can be
# modified with the "set snmp timefilter break disable" command,
# unfortunately it is not the default. Query with a partial value of zero
# which means no time filter.
sub hasCDP { sub hasCDP {
my $enterasys = shift; my $enterasys = shift;
@@ -184,7 +178,7 @@ sub c_ip {
my $partial = shift; my $partial = shift;
my $cdp = $enterasys->SUPER::c_ip($partial) || {}; my $cdp = $enterasys->SUPER::c_ip($partial) || {};
my $lldp = $enterasys->lldp_ip(0) || {}; my $lldp = $enterasys->lldp_ip($partial) || {};
my %c_ip; my %c_ip;
foreach my $iid ( keys %$cdp ) { foreach my $iid ( keys %$cdp ) {
@@ -207,7 +201,7 @@ sub c_if {
my $enterasys = shift; my $enterasys = shift;
my $partial = shift; my $partial = shift;
my $lldp = $enterasys->lldp_if(0) || {}; my $lldp = $enterasys->lldp_if($partial) || {};
my $cdp = $enterasys->SUPER::c_if($partial) || {}; my $cdp = $enterasys->SUPER::c_if($partial) || {};
my %c_if; my %c_if;
@@ -231,7 +225,7 @@ sub c_port {
my $enterasys = shift; my $enterasys = shift;
my $partial = shift; my $partial = shift;
my $lldp = $enterasys->lldp_port(0) || {}; my $lldp = $enterasys->lldp_port($partial) || {};
my $cdp = $enterasys->SUPER::c_port($partial) || {}; my $cdp = $enterasys->SUPER::c_port($partial) || {};
my %c_port; my %c_port;
@@ -255,7 +249,7 @@ sub c_id {
my $enterasys = shift; my $enterasys = shift;
my $partial = shift; my $partial = shift;
my $lldp = $enterasys->lldp_id(0) || {}; my $lldp = $enterasys->lldp_id($partial) || {};
my $cdp = $enterasys->SUPER::c_id($partial) || {}; my $cdp = $enterasys->SUPER::c_id($partial) || {};
my %c_id; my %c_id;
@@ -279,7 +273,7 @@ sub c_platform {
my $enterasys = shift; my $enterasys = shift;
my $partial = shift; my $partial = shift;
my $lldp = $enterasys->lldp_rem_sysdesc(0) || {}; my $lldp = $enterasys->lldp_rem_sysdesc($partial) || {};
my $cdp = $enterasys->SUPER::c_platform($partial) || {}; my $cdp = $enterasys->SUPER::c_platform($partial) || {};
my %c_platform; my %c_platform;

View File

@@ -38,7 +38,7 @@ use SNMP::Info::LLDP;
@SNMP::Info::Layer3::Juniper::ISA = qw/SNMP::Info::Layer3 SNMP::Info::LLDP Exporter/; @SNMP::Info::Layer3::Juniper::ISA = qw/SNMP::Info::Layer3 SNMP::Info::LLDP Exporter/;
@SNMP::Info::Layer3::Juniper::EXPORT_OK = qw//; @SNMP::Info::Layer3::Juniper::EXPORT_OK = qw//;
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/; use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE/;
$VERSION = '2.07'; $VERSION = '2.07';
@@ -116,10 +116,10 @@ sub serial {
# 'i_trunk' => 'jnxExVlanPortAccessMode', # 'i_trunk' => 'jnxExVlanPortAccessMode',
sub i_trunk { sub i_trunk {
my ($juniper) = shift; my $juniper = shift;
my ($partial) = shift; my $partial = shift;
my ($access) = $juniper->jnxExVlanPortAccessMode($partial); my $access = $juniper->jnxExVlanPortAccessMode($partial);
my %i_trunk; my %i_trunk;
@@ -134,22 +134,12 @@ sub i_trunk {
return \%i_trunk; return \%i_trunk;
} }
# 'v_name' => 'jnxExVlanName',
sub v_name {
my ($juniper) = shift;
my ($partial) = shift;
my ($v_name) = $juniper->jnxExVlanName($partial);
return $v_name;
}
# 'v_type' => 'jnxExVlanType', # 'v_type' => 'jnxExVlanType',
sub v_type { sub v_type {
my ($juniper) = shift; my $juniper = shift;
my ($partial) = shift; my $partial = shift;
my ($v_type) = $juniper->jnxExVlanType($partial); my $v_type = $juniper->jnxExVlanType($partial);
return $v_type; return $v_type;
} }
@@ -165,41 +155,35 @@ sub v_index {
} }
sub i_vlan { sub i_vlan {
my ($juniper) = shift; my $juniper = shift;
my ($partial) = shift; my $partial = shift;
my $index = $juniper->bp_index(); my $index = $juniper->bp_index();
my $v_ports = $juniper->qb_v_egress() || {};
my ($i_type) = $juniper->i_type($partial); # If given a partial it will be an ifIndex, we need to use dot1dBasePort
my ($i_descr) = $juniper->i_description($partial); if ($partial) {
my ($v_index) = $juniper->jnxExVlanTag($partial); my %r_index = reverse %$index;
$partial = $r_index{$partial};
my %i_vlan;
foreach my $idx ( sort keys %$v_ports ) {
next unless ( defined $v_ports->{$idx} );
my $portlist = $v_ports->{$idx}; # is an array reference
my $ret = [];
# Convert portlist bit array to bp_index array
for ( my $i = 0; $i <= $#$portlist; $i++ ) {
push( @{$ret}, $i + 1 ) if ( @$portlist[$i] );
}
foreach my $port ( @{$ret} ) {
my $ifindex = $index->{$port};
next unless ( defined($ifindex) ); # shouldn't happen
next if ( defined $partial and $ifindex !~ /^$partial$/ );
$i_vlan{$ifindex} = $v_index->{$idx};
}
} }
return \%i_vlan; my $v_index = $juniper->jnxExVlanTag();
} my $i_pvid = $juniper->qb_i_vlan($partial) || {};
my $i_vlan = {};
foreach my $bport ( keys %$i_pvid ) {
my $q_vlan = $i_pvid->{$bport};
my $vlan = $v_index->{$q_vlan};
my $ifindex = $index->{$bport};
unless ( defined $ifindex ) {
print " Port $bport has no bp_index mapping. Skipping.\n"
if $DEBUG;
next;
}
$i_vlan->{$ifindex} = $vlan;
}
return $i_vlan;
}
sub i_vlan_membership { sub i_vlan_membership {
my $juniper = shift; my $juniper = shift;