• November 17, 2019, 11:15:51 AM
Welcome, Guest. Please login or register. Registration is free.
Did you miss your activation email?

Author Topic: Port Inactivity Report  (Read 6681 times)

0 Members and 2 Guests are viewing this topic.

Offline JM

  • Rookie
  • **
  • Posts: 7
Port Inactivity Report
« on: October 07, 2010, 09:39:34 AM »
Hi Michael,
I noticed you have a script for portusage, I'm unable to download it but was wondering if you could explain how yours works. I'm new to perl so this is going to be interesting to say the least. I noticed the ifdescription, iflastchange, ifadminstatus, ifoperstatus would give me what i need. If i was able to provide a txt file with all the switch ip's and dump the results to an excel sheet, i could filter through what i need. Any help or point in the right direction would be appreciated.

Thank you.




Offline Michael McNamara

  • Administrator
  • Hero Member
  • *****
  • Posts: 3840
    • michaelfmcnamara
    • Michael McNamara
Re: Port Inactivity Report
« Reply #1 on: October 07, 2010, 12:23:14 PM »
I've never published the complete script...

In short I use a Perl script to walk the ifIndex table and check the ifInOctets on every port on every switch. I then compare the ifInOctets count from the time the script was previously run, if the number (ifInOctets) hasn't changed it's safe to assume there's been no activity on the port. If you run the script for 30 days, then after 30 days you'll be able to tell which ports have been active and which have been idle (the ifInOctets count hasn't changed in 30 days). I'm just using 30 days as an example, you can use however long you feel comfortable with.

Good Luck!
We've been helping network engineers, system administrators and technology professionals since June 2009.
If you've found this site useful or helpful, please help me spread the word. Link to us in your blog or homepage - Thanks!

Offline Andy

  • Rookie
  • **
  • Posts: 14
Re: Port Inactivity Report
« Reply #2 on: August 08, 2011, 08:17:20 AM »
Hi Michael,

Im interested in viewing your portreport.pl script from your blog, but the link seems to missing. Has it been taken down for any reason?

Thanks
Andy

Offline Michael McNamara

  • Administrator
  • Hero Member
  • *****
  • Posts: 3840
    • michaelfmcnamara
    • Michael McNamara
Re: Port Inactivity Report
« Reply #3 on: August 08, 2011, 10:16:57 PM »
Hi Andy and welcome to the forums!

Hmmm... I think I just never got a chance to completely sanitize it. If you give me a day I can probably clean it up and publish a link.

Let me know if you are interested.

Cheers!
We've been helping network engineers, system administrators and technology professionals since June 2009.
If you've found this site useful or helpful, please help me spread the word. Link to us in your blog or homepage - Thanks!

Offline Andy

  • Rookie
  • **
  • Posts: 14
Re: Port Inactivity Report
« Reply #4 on: August 09, 2011, 05:06:37 AM »
That would be great!

thanks
Andy

Offline Michael McNamara

  • Administrator
  • Hero Member
  • *****
  • Posts: 3840
    • michaelfmcnamara
    • Michael McNamara
Re: Port Inactivity Report
« Reply #5 on: August 09, 2011, 05:15:58 PM »
Let me clean it up (sanitize it) and I'll post it up.

Cheers!
We've been helping network engineers, system administrators and technology professionals since June 2009.
If you've found this site useful or helpful, please help me spread the word. Link to us in your blog or homepage - Thanks!

Offline Michael McNamara

  • Administrator
  • Hero Member
  • *****
  • Posts: 3840
    • michaelfmcnamara
    • Michael McNamara
Re: Port Inactivity Report
« Reply #6 on: August 11, 2011, 11:18:38 PM »
We've been helping network engineers, system administrators and technology professionals since June 2009.
If you've found this site useful or helpful, please help me spread the word. Link to us in your blog or homepage - Thanks!

Offline martaz

  • Rookie
  • **
  • Posts: 7
Re: Port Inactivity Report
« Reply #7 on: May 08, 2012, 10:33:07 PM »
Hi Michael
I came across this script and I am interested to explore this how I can use to gather statistic on my switches. Can you tell me how should I execute this scripts of yours?
Sorry I am abit ignorance on scripting.

Offline Michael McNamara

  • Administrator
  • Hero Member
  • *****
  • Posts: 3840
    • michaelfmcnamara
    • Michael McNamara
Re: Port Inactivity Report
« Reply #8 on: May 08, 2012, 10:44:33 PM »
Hi Michael
I came across this script and I am interested to explore this how I can use to gather statistic on my switches. Can you tell me how should I execute this scripts of yours?
Sorry I am abit ignorance on scripting.

Hi martaz and welcome to the forums!

You would need a Linux (or Windows) server with Perl and the Net-SNMP modules installed. The Perl script makes calls to the switch equipment utilizing SNMP and then records the ifInOctets for each port. If the number doesn't increase over time then the port is idle. After a variable number of idle days you can physically go reclaim the port.

Good Luck!
We've been helping network engineers, system administrators and technology professionals since June 2009.
If you've found this site useful or helpful, please help me spread the word. Link to us in your blog or homepage - Thanks!