05-28-2020 05:38 AM
Hello,
I would like to call up the ports on a switch that have not been used for 14 weeks. I have given this command:
show int | i proto.*notconnect|proto.*administratively down|Last in.* [14]w|Last in.*[0-9][0-9]w|[0-9]y|disabled|Last input never, output never, output hang never
Is the command correct?
What does mean .*[0-9][0-9]w|[0-9]" ?
Thank you very much.
05-28-2020 07:11 AM
What does mean this output ?
GigabitEthernet1/0/1 is down, line protocol is down (notconnect)
Last input never, output never, output hang never
Was this port never in use?
05-28-2020 07:56 AM
Hello @beta_admin66 ,
it means the port has never been up/up since last reload of the switch.
However, be aware that on some platforms and IOS version the sentence
>> Last input never, output never
appear also for ports that are in up/up with an input rate and an output rate.
This is a SW bug or SW limitation. You need to check the appearence of the line for ports that are up/up
Hope to help
Giuseppe
05-28-2020 11:42 PM
It is a Cisco Catalyst 2950, WS-C2950G-48-EI.
05-28-2020 02:14 PM
05-29-2020 12:23 AM
Hello,
I also noticed something else:
switchxy>show int | i proto.*notconnect|proto.*administratively down|Last in.* [14]w|Last in.*[0-14][0-14]w|[0-9]y|disabled|Last input never,output, output hang never
FastEthernet0/35 is down, line protocol is down (notconnect) -> here is no output about the weeks/year
switchxy>show int FastEthernet0/35
FastEthernet0/35 is down, line protocol is down (notconnect)
Last input 36w2d, output 36w2d, output hang never --> here is an output about the weeks/year
What does this mean: .*[0-14][0-14]w|[0-9] ?
Thank you
05-29-2020 01:00 AM
Hello,
.*[0-14][0-14]w|[0-9]
refers to last input and output parameters. You will only see anything that is equal or less to 14 weeks. If you want to include a higher number, you have to change the parameters marked in bold:
switchxy>show int | i proto.*notconnect|proto.*administratively down|Last in.* [14]w|Last in.*[0-14][0-14]w|[0-9]y|disabled|Last input never,output, output hang never
05-29-2020 01:01 AM
Hello @beta_admin66 ,
>> What does this mean: .*[0-14][0-14]w|[0-9] ?
It is a regular expression that is a way to match variable strings or patterns. However, I think a more correct syntax should be:
.*[1-9][4-9]w[0-9]
the .* means one of more occurrences of the following pattern.
The pattern is made of characters taken from a set the set in square brackets, in this case we would like the first char to be 1 or greater and the second char to be 4 to 9 in this way you should be able to match all ports unused for 14 weeks or more. The w is literaly the w character the subsequent is a don't care.
Hope to help
Giuseppe
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