filtering "SH PORT" or "SH INT" for only certain fields?

Unanswered Question
Apr 23rd, 2007

Is there a way to filter the output of the "sh port" (Cat) or "sh int" (ios) command so that I only get certain fields? There doesn't seem to be a "|incl" option for these commands. Is there another way? I want to see port, name, duplex, speed, align-err, fcs-err, and runts. We suspect mismatches on speed/duplex settings and want to reset counters, wait a day, then get this output on three 6509 switches (two cat-based, one ios-based). Any help would be appreciated. Thank you.

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Joe Clarke Mon, 04/23/2007 - 08:58

If you have recent enough versions of CatOS and IOS, you have the ability to use TCL to code filters for the show port/show int commands. CatOS 8.x and IOS 12.2(18)SXF5 and higher give you this capability. See http://www.cisco.com/en/US/products/sw/iosswrel/ps5207/products_feature_guide09186a00801a75a7.html for more info on TCL in IOS. CatOS's TCL is not nearly as powerful, but it should be sufficient for filtering show port output. See http://www.cisco.com/en/US/products/hw/switches/ps708/products_configuration_guide_chapter09186a008019eff0.html#wp1038944 for tips on using TCL on CatOS.

Paul Williams Tue, 04/24/2007 - 07:02

Using LMS and especially RME 4.0.5 I have used the NetShow functionality to do this.

Go NetShow>NetShow Jobs>Create

and then in the Custom Commands box, enter the command

sh port | include xxxx

where xxxx is the part you wish to filter on.

Its not perfect but it works.

Actions

This Discussion