How to find when a port was last used

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
Campus switch see lots of changes and need to find a way to show ports that have not been used in a set period of time.
Photo of Micheal Beeler

Micheal Beeler

  • 70 Points

Posted 3 years ago

  • 0
  • 1
Photo of David Coglianese

David Coglianese, Embassador

  • 7,388 Points 5k badge 2x thumb
Look under capacity planning in inventory manager
Photo of Jan Steinbach

Jan Steinbach

  • 1,192 Points 1k badge 2x thumb
When no NetSight is avaible and you are also looking for an great NMS YOU can do this with NeDi:

http://www.nedi.ch

https://youtu.be/JLU4RwUnjQA

Cheers,
Jan
Photo of Mike Thomas

Mike Thomas, Employee - GTAC - NMS

  • 7,650 Points 5k badge 2x thumb
If one were to browse the Mibs or snmp walk directly. Gathering sysuptime for the device, then ifLastChange will tell the last time the port state changed, and if IfOperStatus is down, then the port is not currently in use.
So a sysuptime of 30 days and a iflastchange of 20 days means the state changed 10 days ago.
If a sysuptime is 0. The port was typically never operational since last boot.
This is the hard way to do it.
Photo of Christoph

Christoph

  • 1,862 Points 1k badge 2x thumb
It's not what you are really looking for, however an indirectly possibility would be to compare Link Status and "Bytes Transferred" in Capacity Planing Report. If zero bytes were transmitted on a port, probably this one was never up since the switch is running.
(Edited)
Photo of Mary Frampton

Mary Frampton

  • 70 Points
Is this person's assumption correct?  I have a switch that has been up for 200 days, I need to know if the ports were active in the last 6 months at least. Thanks!
Photo of David Coglianese

David Coglianese, Embassador

  • 7,378 Points 5k badge 2x thumb
It compares backups, so the dates are the oldest and newest backup.

I try to only use the ports that show no "Bytes Transferred"
Photo of Brandon Clay

Brandon Clay, Escalation Support Engineer

  • 13,488 Points 10k badge 2x thumb
Another option is to check via CLI.

show port info detail | include Port:|Link\sState:|Link\sUps:|Link\sDowns:
 will get you a pretty concise list of all ports with their current state as well as the time of the last link up and link down. See the example output below from one of my lab switches.

X440G2-12t-10G4.1 # show port info detail | inc Port:|Link\sState:|Link\sUps:|Link\sDowns: 
Port:	1
Link State: Active, 1Gbps, full-duplex
Link Ups:       1        Last: Thu Aug 03 16:59:29 2017
Link Downs:     0        Last: --
Port: 2
Link State: Ready
Link Ups:       0        Last: --
Link Downs:     0        Last: --
(Edited)
Photo of Mary Frampton

Mary Frampton

  • 70 Points
I'm running on a stacked c5.  Is there an equivalent to this command in that OS?
Photo of Brandon Clay

Brandon Clay, Escalation Support Engineer

  • 13,488 Points 10k badge 2x thumb
As far as I know, there isn't an equivalent on the C5. However, I'm much more familiar with EXOS that with the C5, so maybe someone with better knowledge of the C5 will be able to show us a way to pull this info out of the CLI.
Photo of David Coglianese

David Coglianese, Embassador

  • 7,388 Points 5k badge 2x thumb
I spoke to someone who indicated this was a good report to determine unused ports as long as capacity planning was part of the archive process.

I need to verify that it is an accurate report and understand how a singe device can have too different dates in the date field.

According to "Help" Date = The date and time of the data sample used to generate the port information.



Thanks,
Photo of EtherMAN

EtherMAN, Embassador

  • 7,340 Points 5k badge 2x thumb
If you have a syslog server you could also query via a filter to switch ip switch port and get all the  port for up down entries within your date range.  Depending on how many ports are inactive as how many times you would need to repeat the query changing the port filter.