- Community Home
- >
- Networking
- >
- Legacy
- >
- Switches, Hubs, Modems
- >
- SNMP Walk Script Help
Switches, Hubs, and Modems
1822430
Members
2924
Online
109642
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2004 03:55 AM
02-03-2004 03:55 AM
SNMP Walk Script Help
I'm trying to write a [simple] script and I need some help doing it. I am looking to track unused switch ports.
What I am trying to do is this:
1. snmpget sysUPtime
2. snmpwalk ifOperstatus |grep "down"
**use awk, get the ifIndex of the results from step 2, then do:
3. snmpget ifLastChange.
**This will give me the uptime which the last state transition on an interface took place.
4. DOWNTIME=(Step1 - Step3) / 8640000
Thanks for your help!
What I am trying to do is this:
1. snmpget
2. snmpwalk
**use awk, get the ifIndex of the results from step 2, then do:
3. snmpget
**This will give me the uptime which the last state transition on an interface took place.
4. DOWNTIME=(Step1 - Step3) / 8640000
Thanks for your help!
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2004 12:47 AM
02-25-2004 12:47 AM
Re: SNMP Walk Script Help
This is tricky. I'm interested in this also, and the problems I ran into are:
1. A person leaves for vacation and, for 15 days, there will be no traffic on his/her port (ifInOctets and ifOutOctets will stay constant), and ifOperStatus is "down". If in the 10-th day I need a port in that switch - do I disconnect this port? It happened to me to disconnect TopMgmt and I've got kicked around when they returned :-)
2. When a switch restarts, it zeroes all counters, including sysUpTime and interface counters.
3. People may move from one network jack to another, leaving non-zero values of if??Octets on the old port.
4. Printers with powersave feature might appear "down".
I think than we have to think statistically. One can say, at any time, with a certain confidence level (0% to 100%) that there is a probability (0 to 1) a switch port is free, based on periodic reading and interpretation of SNMP port properties.
For example, if one port showed 0 bytes traffic variation (constant non-zero if??Octets value), and it was "down" for 50 consecutive days each time we sampled it, we can say with 100% confidence that this port has a probability of 1 of being free. The value of 50 days is based on the maximum vacation time of 35 working days (7 weeks = 49 calendar days).
But people might be gone for 60 or 90 days for some training abroad... so the criteria to decide if the port is truly free must be a compozite. We might have to wait 1/4 of a year to decide in this way that a port is 100% free.
Fluke's NetTool or LinkRunner might help to reduce this time: go to the switch, unplug the patch cable from a port with no light, plug it in NetTool and see if there is a NIC at the other end.
Interestin', huh?
1. A person leaves for vacation and, for 15 days, there will be no traffic on his/her port (ifInOctets and ifOutOctets will stay constant), and ifOperStatus is "down". If in the 10-th day I need a port in that switch - do I disconnect this port? It happened to me to disconnect TopMgmt and I've got kicked around when they returned :-)
2. When a switch restarts, it zeroes all counters, including sysUpTime and interface counters.
3. People may move from one network jack to another, leaving non-zero values of if??Octets on the old port.
4. Printers with powersave feature might appear "down".
I think than we have to think statistically. One can say, at any time, with a certain confidence level (0% to 100%) that there is a probability (0 to 1) a switch port is free, based on periodic reading and interpretation of SNMP port properties.
For example, if one port showed 0 bytes traffic variation (constant non-zero if??Octets value), and it was "down" for 50 consecutive days each time we sampled it, we can say with 100% confidence that this port has a probability of 1 of being free. The value of 50 days is based on the maximum vacation time of 35 working days (7 weeks = 49 calendar days).
But people might be gone for 60 or 90 days for some training abroad... so the criteria to decide if the port is truly free must be a compozite. We might have to wait 1/4 of a year to decide in this way that a port is 100% free.
Fluke's NetTool or LinkRunner might help to reduce this time: go to the switch, unplug the patch cable from a port with no light, plug it in NetTool and see if there is a NIC at the other end.
Interestin', huh?
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP