From 60cb2b8c2035b133c622e9307723af9e4e1df933 Mon Sep 17 00:00:00 2001 From: Eric Miller <> Date: Sat, 24 Nov 2007 03:18:13 +0000 Subject: [PATCH] Psuedo ENTITY-MIB information --- Info/Airespace.pm | 312 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 312 insertions(+) diff --git a/Info/Airespace.pm b/Info/Airespace.pm index 52a505d2..12876f73 100644 --- a/Info/Airespace.pm +++ b/Info/Airespace.pm @@ -47,11 +47,14 @@ use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/; %GLOBALS = ( %SNMP::Info::GLOBALS, + 'airespace_type' => 'agentInventoryMachineType', 'airespace_model' => 'agentInventoryMachineModel', 'airespace_serial' => 'agentInventorySerialNumber', + 'airespace_maint_ver' => 'agentInventoryMaintenanceLevel', 'airespace_mac' => 'agentInventoryBurnedInMacAddress', 'airespace_os' => 'agentInventoryOperatingSystem', 'airespace_vendor' => 'agentInventoryManufacturerName', + 'airespace_prod_name' => 'agentInventoryProductName', 'os_ver' => 'agentInventoryProductVersion', 'airespace_bssid_mode' => 'agentNetworkBroadcastSsidMode', 'airespace_mc_mode' => 'agentNetworkMulticastMode', @@ -83,8 +86,10 @@ use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/; 'airespace_ap_ip' => 'bsnApIpAddress', 'airespace_ap_loc' => 'bsnAPLocation', 'airespace_ap_sw' => 'bsnAPSoftwareVersion', + 'airespace_ap_fw' => 'bsnAPBootVersion', 'airespace_ap_model' => 'bsnAPModel', 'airespace_ap_serial' => 'bsnAPSerialNumber', + 'airespace_ap_type' => 'bsnAPType', 'airespace_ap_status' => 'bsnAPAdminStatus', # AIRESPACE-WIRELESS-MIB::bsnAPIfTable 'airespace_apif_slot' => 'bsnAPIfSlotId', @@ -641,6 +646,234 @@ sub i_80211channel { return \%i_80211channel; } + +# Psuedo ENTITY-MIB methods + +sub e_index { + my $airespace = shift; + + my $ap_model = $airespace->airespace_ap_model() || {}; + + my %e_index; + # Chassis + $e_index{1} = 1; + + # We're going to hack an index to capture APs + foreach my $idx (keys %$ap_model){ + # Create the integer index by joining the last three octets of the MAC. + # Hopefully, this will be unique since the manufacturer should be + # limited to Airespace and Cisco. We can't use the entire MAC since + # we would exceed the intger size limit. + if ($idx =~ /(\d+\.\d+\.\d+)$/) { + my $index = int (join('',map { sprintf "%03d",$_ } split /\./, $1)); + $e_index{$idx} = $index; + } + } + return \%e_index; +} + +sub e_class { + my $airespace = shift; + + my $e_idx = $airespace->e_index() || {}; + + my %e_class; + foreach my $iid (keys %$e_idx){ + if ($iid eq 1) { + $e_class{$iid} = 'chassis'; + } + # This isn't a valid PhysicalClass, but we're hacking this anyway + else { + $e_class{$iid} = 'ap'; + } + } + return \%e_class; +} + +sub e_name { + my $airespace = shift; + + my $ap_name = $airespace->airespace_ap_name() || {}; + + my %e_name; + # Chassis + $e_name{1} = 'WLAN Controller'; + + # APs + foreach my $iid (keys %$ap_name){ + $e_name{$iid} = 'AP'; + } + return \%e_name; +} + +sub e_descr { + my $airespace = shift; + + my $ap_model = $airespace->airespace_ap_model() || {}; + my $ap_name = $airespace->airespace_ap_name() || {}; + my $ap_loc = $airespace->airespace_ap_loc() || {}; + + my %e_descr; + # Chassis + $e_descr{1} = $airespace->airespace_prod_name(); + + # APs + foreach my $iid (keys %$ap_name){ + my $name = $ap_name->{$iid}; + next unless defined $name; + my $model = $ap_model->{$iid} || 'AP'; + my $loc = $ap_loc->{$iid} || 'unknown'; + + $e_descr{$iid} = "$model: $name ($loc)"; + } + return \%e_descr; +} + +sub e_model { + my $airespace = shift; + + my $ap_model = $airespace->airespace_ap_model() || {}; + + my %e_model; + # Chassis + $e_model{1} = $airespace->airespace_model(); + + # APs + foreach my $iid (keys %$ap_model){ + my $model = $ap_model->{$iid}; + next unless defined $model; + + $e_model{$iid} = $model; + } + return \%e_model; +} + +sub e_type { + my $airespace = shift; + + my $ap_type = $airespace->airespace_ap_type() || {}; + + my %e_type; + # Chassis + $e_type{1} = $airespace->airespace_type(); + + # APs + foreach my $iid (keys %$ap_type){ + my $type = $ap_type->{$iid}; + next unless defined $type; + + $e_type{$iid} = $type; + } + return \%e_type; +} + +sub e_fwver { + my $airespace = shift; + + my $ap_fw = $airespace->airespace_ap_fw() || {}; + + my %e_fwver; + # Chassis + $e_fwver{1} = $airespace->airespace_maint_ver(); + + # APs + foreach my $iid (keys %$ap_fw){ + my $fw = $ap_fw->{$iid}; + next unless defined $fw; + + $e_fwver{$iid} = $fw; + } + return \%e_fwver; +} + +sub e_vendor { + my $airespace = shift; + + my $e_idx = $airespace->e_index() || {}; + + my %e_vendor; + foreach my $iid (keys %$e_idx){ + $e_vendor{$iid} = 'cisco'; + } + return \%e_vendor; +} + +sub e_serial { + my $airespace = shift; + + my $ap_serial = $airespace->airespace_ap_serial() || {}; + + my %e_serial; + # Chassis + $e_serial{1} = $airespace->airespace_serial(); + + # APs + foreach my $iid (keys %$ap_serial){ + my $serial = $ap_serial->{$iid}; + next unless defined $serial; + + $e_serial{$iid} = $serial; + } + return \%e_serial; +} + +sub e_pos { + my $airespace = shift; + + my $e_idx = $airespace->e_index() || {}; + + my %e_pos; + my $pos = 0; + foreach my $iid (sort keys %$e_idx){ + if ($iid eq 1) { + $e_pos{$iid} = -1; + next; + } + else { + $pos++; + $e_pos{$iid} = $pos; + } + } + return \%e_pos; +} + +sub e_swver { + my $airespace = shift; + + my $ap_sw = $airespace->airespace_ap_sw() || {}; + + my %e_swver; + # Chassis + $e_swver{1} = $airespace->airespace_os(); + + # APs + foreach my $iid (keys %$ap_sw){ + my $sw = $ap_sw->{$iid}; + next unless defined $sw; + + $e_swver{$iid} = $sw; + } + return \%e_swver; +} + +sub e_parent { + my $airespace = shift; + + my $e_idx = $airespace->e_index() || {}; + + my %e_parent; + foreach my $iid (sort keys %$e_idx){ + if ($iid eq 1) { + $e_parent{$iid} = 0; + next; + } + else { + $e_parent{$iid} = 1; + } + } + return \%e_parent; +} + 1; __END__ @@ -710,6 +943,10 @@ These are methods that return scalar value from SNMP =over +=item $airespace->airespace_type() + +(B) + =item $airespace->airespace_model() (B) @@ -718,6 +955,10 @@ These are methods that return scalar value from SNMP (B) +=item $airespace->airespace_maint_ver() + +(B) + =item $airespace->airespace_mac() (B) @@ -730,6 +971,10 @@ These are methods that return scalar value from SNMP (B) +=item $airespace->airespace_prod_name() + +(B) + =item $airespace->os_ver() (B) @@ -937,6 +1182,10 @@ User specified location of this AP. (B) +=item $airespace->airespace_ap_fw() + +(B) + =item $airespace->airespace_ap_model() (B) @@ -945,6 +1194,10 @@ User specified location of this AP. (B) +=item $airespace->airespace_ap_type() + +(B) + =item $airespace->airespace_ap_status() (B) @@ -1288,4 +1541,63 @@ airespace_sta_slot() combined to match the interface iid. (B) +=back + +=head2 Psuedo ENTITY-MIB information + +These methods emulate ENTITY-MIB Physical Table methods using +AIRESPACE-SWITCHING-MIB and AIRESPACE-WIRELESS-MIB. Thin APs are included +as subcomponents of the wireless controller. + +=over + +=item $airespace->e_index() + +Returns reference to hash. Key: IID and Value: Integer. The index for APs is +created with an integer representation of the last three octets of the +AP MAC address. + +=item $airespace->e_class() + +Returns reference to hash. Key: IID, Value: General hardware type. Return ap +for wireless access points. + +=item $airespace->e_descr() + +Returns reference to hash. Key: IID, Value: Human friendly name. + +=item $airespace->e_model() + +Returns reference to hash. Key: IID, Value: Model name. + +=item $airespace->e_vendor() + +Returns reference to hash. Key: IID, Value: cisco. + +=item $airespace->e_serial() + +Returns reference to hash. Key: IID, Value: Serial number. + +=item $airespace->e_pos() + +Returns reference to hash. Key: IID, Value: The relative position among all +entities sharing the same parent. + +=item $airespace->e_type() + +Returns reference to hash. Key: IID, Value: Type of component. + +=item $airespace->e_fwver() + +Returns reference to hash. Key: IID, Value: Firmware revision. + +=item $airespace->e_swver() + +Returns reference to hash. Key: IID, Value: Software revision. + +=item $airespace->e_parent() + +Returns reference to hash. Key: IID, Value: The value of e_index() for the +entity which 'contains' this entity. + =cut