cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1339
Views
0
Helpful
7
Replies

Find unused ports for since 14 weeks

beta_admin66
Level 1
Level 1

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.

 

7 Replies 7

beta_admin66
Level 1
Level 1

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?

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

 

It is a Cisco Catalyst 2950, WS-C2950G-48-EI.

Leo Laohoo
Hall of Fame
Hall of Fame
What is the model of the switch?
If the switch is a Catalyst 4k, then use the command "sh interface link".

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

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

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

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card