Summarize IOS printouts (example: Frame Relay DLCIs)
I've always wanted a short summary display of DLCIs configured on my Frame Relay boxes (or whatever your favorite WAN technology is), but the only printout I would get from the router would be the lengthy show frame pvc printout. Fortunately, a judicious use of output filters can get you a summary printout from almost anything Cisco IOS produces.
For example, I would like to see just the highlighted lines in my show frame pvc printout:
b2#show frame pvcThe first line I'm interested in contains the pattern for interface, the second one DLCI USAGE. My output filter would thus have to match any one of these patterns:
PVC Statistics for interface Serial0/0/0 (Frame Relay DTE)
Active Inactive Deleted Static
Local 1 0 0 0
Switched 0 0 0 0
Unused 3 0 0 0
DLCI = 101, DLCI USAGE = LOCAL, PVC STATUS = ACTIVE, INTERFACE = Serial0/0/0.101
input pkts 1003 output pkts 948 in bytes 107601
out bytes 106438 dropped pkts 68 in pkts dropped 68
out pkts dropped 0 out bytes dropped 0
... rest deleted ...
b2#show frame pvc ¦ include (for interface¦DLCI USAGE)And to add icing on the cake, I defined an alias with the alias exec dlci show frame pvc ¦ include (for interface ¦ DLCI USAGE) configuration command. Now I can display the FR DLCI status with a simple dlci command.
PVC Statistics for interface Serial0/0/0 (Frame Relay DTE)
DLCI = 101, DLCI USAGE = LOCAL, PVC STATUS = ACTIVE, INTERFACE = Serial0/0/0.101
DLCI = 201, DLCI USAGE = UNUSED, PVC STATUS = ACTIVE, INTERFACE = Serial0/0/0
DLCI = 302, DLCI USAGE = UNUSED, PVC STATUS = ACTIVE, INTERFACE = Serial0/0/0
DLCI = 401, DLCI USAGE = UNUSED, PVC STATUS = ACTIVE, INTERFACE = Serial0/0/0
I love this trick, though. I wish there was a detailed study on exactly which bits of Regular Expression functionality are implemented in the include/exclude/begin output filters. I actually liked "begin" so much that I duplicated its functionality on my FreeBSD machine.
Just found your blog yesterday, looks to be a great resource.
Cool blog too, congrats !