Skip to main content

We continue to rely almost exclusively on Forward Networks for our lifecycle management and planning (purchasing).  One of the big gaps, however, was I couldn’t get the Wireless Access Points on the network, and had to go to other devices and export it into excel. Not terrible, but time consuming. 

You can also check out my related post:

 

I threw together simple script to collect the Cisco AP’s “Name/Location/AP-Model/IP-Address/Country-Code. 

@AhmedKhedr 

Pre-requisites:

  1. Add Custom Command to IOS-XE for collection “show ap sum”
  2. Add Tag of “WLC” on your Wireless Controllers
  3. WLC’s are on c9800 running IOS-XE
  4. IOS-XE version is 17.9.6

It appears older versions of OS (<17.9.6) don’t align nicely, but i’m sure you can adjust for it using the core of this script. I’m adding one more table to this, to pull the LDoS date from the model that is pulled from the custom command… which I will update when I get it to work ;-)

/**
* @intent - pull Name & Model & IP address
* @description Log into Cisco WLC's "C9800" and pull AP information from the controllers with "show ap summary"
Note - OS's older than "17.09.06" might require reformatting the pattern to pull what you want.
**/

// Pattern of output//
AP_INFO =
```
{APName:string} {Slots:number} {Model:string} {EthMAC:string} {RadioMac:string} {CC:string} {RD:string} {IP:string} {State:string} {Location:string}
```;
foreach Device in network.devices
foreach Tag in Device.tagNames
where Tag == "WLC"
foreach Command in Device.outputs.commands
where Command.commandText == "show ap sum"
let parsed = parseConfigBlocks(OS.IOS_XE, Command.response) //parses text into lines
let matchData = blockMatches(parsed, AP_INFO) //applies pattern to lines

foreach x in matchData
select {
name: Device.name,
Location: Device.locationName,
Model: Device.platform.model,
OS: Device.platform.os,
AP_NAME: x.data.APName,
AP_Model: x.data.Model,
"IP Address": x.data.IP,
"Country Code": x.data.CC,
RD: x.data.RD
}

 

What a smart way to find Wireless Access Points - thanks ​@cariddir and ​@AhmedKhedr!


Here is one more add-on to get a simple EoL report for the AP’s

 

/**
* @intent - pull Name & Model & IP address
* @description Log into Cisco WLC's "C9800" and pull AP information from the controllers with "show ap summary"
Note - OS's older than "17.09.06" might require reformatting the pattern to pull what you want.
**/

// Create simple CSV of models on your network with EoL/LDoS Date
AP_HW =
"""csv
VENDOR,Model,EOL
Cisco,AIR-AP3802E-E-K9,2027
Cisco,AIR-AP3802I-E-K9,2027
Cisco,AIR-AP3802I-I-K9,2027
Cisco,C9130AXI-A, TBA
Cisco,C9130AXI-B, TBA
Cisco,C9130AXE-B, TBA
Cisco,C9130AXI-D, TBA
Cisco,C9130AXI-E, TBA
Cisco,C9130AXI-I, TBA
Cisco,C9130AXI-Z, TBA
""";

// Pattern of output//
AP_INFO =
```
{APName:string} {Slots:number} {Model:string}
```;

foreach device in network.devices
let platform = device.platform

foreach Tag in device.tagNames
where Tag == "WLC"

foreach Command in device.outputs.commands
where Command.commandText == "show ap sum"
let parsed = parseConfigBlocks(OS.IOS_XE, Command.response) //parses text into lines
let matchData = blockMatches(parsed, AP_INFO) //applies pattern to lines

foreach x in matchData
foreach entry in AP_HW
where entry.Model == x.data.Model
let LDOS = entry.EOL

select {
name: device.name,
Location: device.locationName,
Model: device.platform.model,
AP_NAME: x.data.APName,
AP_Model: x.data.Model,
"Model LDoS Date": LDOS,
}

 

 


Reply