Wireless Networking
This section will show how to gather management statistics from wireless access points using the 802.11 MIB. The IEEE 802.11 MIB is freely available from many sites, including http://www.cs.ucla.edu/~hywong1/doc/IEEE802dot11-MIB.my. The MIB itself is pretty dense. A detailed discussion of this MIB is beyond the scope of this chapter. Instead, we will present a script that can gather certain data points from your WAP. Consider the following script.
#!/usr/bin/perl use SNMP; $SNMP::use_sprint_value = 1; &SNMP::loadModules('IEEE802dot11-MIB'); my $host = "192.168.1.4"; my $sess = new SNMP::Session(DestHost => $host, Version => 2, Community => "public"); my %wapStats; my $var = new SNMP::Varbind(['dot11CurrentChannel']); do { $val = $sess->getnext($var); my $channel = $var->[$SNMP::Varbind::val_f]; my $ifIndex = $var->[$SNMP::Varbind::iid_f]; my($ssid, $mac, $manufacturer, $model, $rtsFailureCount, $ackFailureCount, $fcsErrorCount) = $sess->get([ ['dot11DesiredSSID',$ifIndex], ['dot11MACAddress',$ifIndex], ['dot11ManufacturerID',$ifIndex], ['dot11ProductID',$ifIndex], ['dot11RTSFailureCount',$ifIndex], ['dot11ACKFailureCount',$ifIndex], ['dot11FCSErrorCount',$ifIndex] ]); $wapStats{$ifIndex} = "$channel,$ssid,$mac,$manufacturer," $wapStats{$ifIndex} .= "$model,$rtsFailureCount,$ackFailureCount,$fcs ErrorCount"; }unless($sess->{ErrorNum}); foreach my $key (sort keys %wapStats){ my($channel, $ssid, $mac, $manufacturer, $model, $rtsFailureCount, $ackFailureCount, $fcsErrorCount) ...
Get Essential SNMP, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.