Sceptically passionate on Enterprise Mobility, AutoID, WLANs, OSes and other technical stuff I happen to work with

Month: September 2016

Often you have to deal with existing AP/Controller and need to understand what’s configured on it. Of course, you can click 100500 times in the GUI all over the place, or read through 20+ pages of “show run” output (those who’ve been to my WING5 training should remember the little space-bar-thrashing exercise). For instance, the full config dump for the WING5 class is about 21KB ~= 29 pages.

Now you can see all the configured rf-domains, profiles, policies, ACLs, WLANs, devices etc in a nice quick overview.

Since WiNG5 controller contains the configuration for the entire network this thing can be very helpful – try fishing this out of the full dump when you have several hundred sites and thousands of devices!

<IMHO>Overall, the way the distributed configuration and reporting is implemented in WiNG5, and how many cool shortcuts and features are available for mass management/deployment/troubleshooting, deserves a dedicated series of articles. After I really don’t want to go back to previous generation UIs</IMHO>

So, what really happened?

show run… |include <regexp> only shows lines that include regexp.

The config (i.e. “pure” show run) looks like this (note the indentations):

Thus, essentially, we need to only show the lines that don’t have space or ‘!’ at the beginning to get all the section names. Alternatively, we could just say, that the line should begin with a letter.

The regexp for “letter” is ‘\w‘. The regexp for “line begins with” is ‘^‘. Thus we get ‘^\w‘ – “begins with a letter“. However, because we’re using a backslash in the CLI, we need to escape it with another backslash, hence ‘^\\w‘. This is it!

P.S. Two pages on text to describe a one-liner… Was there a shorter way? What do you think?