cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
96245
Views
56
Helpful
7
Replies

how to identify unused switchports using show commands

adil.nasser3
Level 1
Level 1

Hello All,

Awhile back I did post a question about this topic but I have not been able to find the answer while searching for it.  I am hoping that someone can post a way to do a variation of the "show interface | inc ???" which can provide a quick report of when which port last showed input and output traffic.

Thanks,

Adil           

1 Accepted Solution

Accepted Solutions

John Blakley
VIP Alumni
VIP Alumni

You could try:

Sh int | inc Fast|Last input

If you have gig ports, change fast to Gig.

Sh int | inc Gig|Last input

This would show you all ports. You could narrow it down by specifying the port you want:

Sh int fa0/1 | inc Last input

Hth,
John

Sent from Cisco Technical Support iPhone App

HTH, John *** Please rate all useful posts ***

View solution in original post

7 Replies 7

John Blakley
VIP Alumni
VIP Alumni

You could try:

Sh int | inc Fast|Last input

If you have gig ports, change fast to Gig.

Sh int | inc Gig|Last input

This would show you all ports. You could narrow it down by specifying the port you want:

Sh int fa0/1 | inc Last input

Hth,
John

Sent from Cisco Technical Support iPhone App

HTH, John *** Please rate all useful posts ***

John,

That command worked perfectly.  See example below..

TN-3750stack-7#show int | inc Fast|Last input

  Last input 00:00:00, output 00:00:00, output hang never

FastEthernet1/0/1 is up, line protocol is up (connected)

  Hardware is Fast Ethernet, address is 0015.2bf4.d903 (bia 0015.2bf4.d903)

  Last input never, output 00:00:01, output hang never

FastEthernet1/0/2 is down, line protocol is down (notconnect)

  Hardware is Fast Ethernet, address is 0015.2bf4.d904 (bia 0015.2bf4.d904)

  Last input never, output never, output hang never

Thanks,

Adil

You can also use show interfaces link

if you want to see those that have been down longer than a week, then

show interfaces link | i week

 

Regards,

Francisco

Hello Adil,

try this command .

show interface | include (FastEthernet|Last input)

if you use Gigabite change the fastethernet to gig. be aware cases sensative .

I like this

tclsh
set interfacesUNUSED [regexp -all -line -inline "^\[FGTPV]+\[A-Za-z0-9\/\-\]+|No traffic" [exec "show int account"]]
set index 0
while {$index < [llength $interfacesUNUSED]} {
set str1 [lindex $interfacesUNUSED [expr $index]]
set str2 [lindex $interfacesUNUSED [expr $index + 1]]
if {[string equal $str2 "No traffic"]} {puts -nonewline [exec "show interfaces $str1 status | e Port.*Name.*Status"]; puts -nonewline " "; puts -nonewline [exec "show int account | include $str1 "]}
set index [expr $index + 1]
}

Anyway be aware that regarding switch ports I have had some experience about the fact that the port was up and traffic counters were incrementing but at the same time "show interface" was showing "Last input never, output never, output hang never" and "show interface accounting" was showing "No traffic sent or received on this interface"

And remember to take care of both the "Last clearing of show interface counters" and the switch uptime.

this works perfect. is there a command for this in other switch platforms? ie 3750/3850/6500/9300/3560, etc

it seems to only be on 4500s(maybe 6500s, not certain)

i know i can do sh int | last input. but a lot of times input/output counters are not accurate. link down counters were VERY acurate

tnx

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: