01-17-2012 07:12 AM - edited 03-07-2019 04:23 AM
I'm troubleshooting a 3750 switch stack problem where computers are showing input and CRC errors. I'd like to be able to execute a "show interface" command that will show me only the line showing the switch port and the line showing the input errors, but so far I can't figure out a way of combining those two parameters.
If I do "show interface | include Ethernet[0-9]\0\" I get all the lines showing the port numbers:
GigabitEthernet1/0/1 is up, line protocol is up (connected)
GigabitEthernet1/0/2 is up, line protocol is up (connected)
GigabitEthernet1/0/3 is up, line protocol is up (connected)
If I do "show interface | include input errors, I get all the lines showing the input and CRC errors, but no indication of what port they're for:
sh interfaces | incl input error
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
6622 input errors, 782 CRC, 0 frame, 0 overrun, 0 ignored
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
2472 input errors, 375 CRC, 0 frame, 0 overrun, 0 ignored
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
Is there a way of combining these two parameters to get something that looks like this?:
GigabitEthernet1/0/1 is up, line protocol is up (connected)
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
GigabitEthernet1/0/2 is up, line protocol is up (connected)
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
etc.
Thanks for any suggestions. Only thing I can think of at this point is to output to a file and then grep, but I was hoping to be able to do this right on the switch.
01-17-2012 07:26 AM
Hi,
maybe you could use some regular expressions:
show interface | include Ethernet[0-9]\0\|error
Regards,
Michael
01-17-2012 08:39 AM
Gives me the same output as simply "show interface | include input error" -- I see no port information. I suspect what I need is some kind of "and" parameter that allows me to specify two different "include" criteria. This appears to ignore the first "include" and only use the second one.
01-18-2012 02:12 AM
Hmmm, strange. I tried this on a router:
cisco#show interfaces | include FastEthernet2|error
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 output errors, 0 collisions, 0 interface resets
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 output errors, 0 collisions, 0 interface resets
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 output errors, 0 collisions, 0 interface resets
FastEthernet2/0 is up, line protocol is up
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 output errors, 0 collisions, 2 interface resets
FastEthernet2/1 is up, line protocol is up
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 output errors, 0 collisions, 2 interface resets
FastEthernet2/2 is up, line protocol is down
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 output errors, 0 collisions, 2 interface resets
The first lines match only the pattern 'error' and then the 'FastEthernet2' pattern or the 'error' pattern are matching.
So show interface | include Ethernet[0-9]\0\|error should be quite the same. Did you maybe just overlooked the Ethernet lines among all the error lines?
04-22-2012 12:56 AM
I realise that this post is very old, but perhaps this command will be of use to someone.
I like to use:
sh interface | i (Vlan|thernet|Port|input error)
To get a list of all the Vlans, Ethernet (Fast, Gigabit or otherwise) and any port channels along with their associated error line. You can also of course change the item after the pipe in the parentheses to identify other information held in the "show interfaces" output, for example:
sh interface | i (Vlan|thernet|Port|5 minute)
Will give you the interface names and their associated 5 minute input and output.
04-22-2012 03:46 PM
Try this: sh interface | i line protocol | i CRC
04-25-2012 04:13 AM
Did this work?
Sent from Cisco Technical Support iPad App
04-25-2012 04:38 AM
It didn't work immediately but when amended to:
sh interface | i line protocol |CRC
It worked as intended.
Neater solution than I proposed, good work.
04-25-2012 05:22 AM
Can I request if you can mark this thread as Answered?
Sent from Cisco Technical Support iPad App
04-25-2012 05:35 AM
I have no option to mark it as answered, was not my original post.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide