[F10-nsp] code to determine IfIndex

Jo Rhett jrhett at svcolo.com
Wed Aug 1 13:54:04 EDT 2007


> On 6/19/07, Jo Rhett <jrhett at svcolo.com> wrote:
>> If you build your own internal management tools, you may have  
>> found the
>> following page lacking in useful details:
>>    https://www.force10networks.com/CSPortal20/KnowledgeBase/ 
>> SNMPFAQ.aspx
>>
>> Well, using that information and snmpwalk output, I found the  
>> following
>> code to determine the IfIndex.
>>
>> The only gotcha is that you really need to know the card type to  
>> get the
>> interface index, which I think blows chunks.  So to use this  
>> script you
>> may need to modify the cardtype value to match your environment.  The
>> script as published below assumings slot 0-1 contains 24-port SFP  
>> cards,
>> and all other slots contain 48-port copper cards.

On Aug 1, 2007, at 10:46 AM, Aaron Glenn wrote:
> I apologize if I'm having a major brain fart and just not realizing it
> -- but wouldn't one rather work the other way. Meaning, lets
> discover/poll the device, get the ifIndexes, and then calculate
> everything?

Yes.  Poll the device and get the card types, then adjust the script.

The issue is when you want to do random/ad-hoc queries, you don't  
want to do a full discovery every time.  In my experience a full pull  
of all switch ports takes 20 seconds to finish.  This allows you to  
determine the right thing to query quickly, when you want an instant  
direct query of something on the switch.

-- 
Jo Rhett
senior geek

Silicon Valley Colocation
Support Phone: 408-400-0550






More information about the force10-nsp mailing list