Using SNMP Walk Scripts

The following procedure helps you in creating sample shell scripts to query all entries in RuckusCtrlAp related tables (AP, AP Radio, AP WLAN).

Steps for using SNMP Walk Scripts

The following are the steps for using SNMP walk scripts.

  1. Get the MAC list using ruckusCTRLSummaryApTable
  2. Translate all output MAC addresses in the OID format
  3. Utilize SNMP cache. It gets all the attributes (based on the rows first and not column) of an AP through snmpget or snmpwalk.

    Do retry for unsuccessful APs if required.

Note: The below scripts are example codes for walking through all the APs in the controller.

Setup Environment

The following is the requirement to setup the required environment.

  • Shell: Dash or bash
  • Operating System: Linux

Procedure

  1. Install NET SNMP client tools (snmpget and snmpwalk) by referring to http://www.net-snmp.org/download.html.
  2. Save the downloaded MIB files in the MIB directory.
  3. Ensure that the following MIB files are installed in the system
    1. IANAifType-MIB
    2. IF-MIB
    3. IPV6-TC
    4. SNMPv2-CONF
    5. SNMPv2-SMI
    6. SNMPv2-TC

Installing SNMP Client Tool

Execute the following script to install SNMP client using:

Ubuntu

apt-get install snmp

RedHat

yum install net-snmp net-snmp-libs net-snmp-utils

Ruckus MIB files in the MIB directory

Execute the following script to save the Ruckus MIB files in the MIB directory using:

Ubuntu and RedHat

cd RUCKUS_MIB_Directory
sudo cp RUCKUS-*.txt /usr/share/snmp/mibs/

Usage

Execute the following script to use the Ruckus MIB files.

sh <sample_script>.sh <SZ IP address> <snmpcmd options>

SNMP CMD Options

Refer to the OPTIONS section in http://net-snmp.sourceforge.net/docs/man/snmpcmd.html. For example, using SNMPv2 with read community public for controller with the IP address 172.17.1.2.

sh walk_ruckusCTRLApTable_sample.sh 172.17.1.2 -mall -v2c -c public

where -mall is an option required for these scripts or you may not be able to get the results.

Tips for Writing Your Own Scripts

  1. Use -Oe with snmpget/snmpwalk to output index(MAC address) in OID format.
  2. snmpget can send 128 OIDs at a time.
  3. Always get all OIDs of the same AP first, instead of OIDs for all APs.
  4. AP related tables cache data for 15 seconds. This means that you may get the same result if you do not wait for cache timeout.
  5. You can use NET-SNMP-AGENT-MIB::nsCacheStatus to check cache status of a table. If your system supports snmpset, you can also force it to clean cache via snmpset.
  6. Be careful with the output format. Refer to OUTPUT OPTIONS link http://net-snmp.sourceforge.net/docs/man/snmpcmd.html