[c-nsp] Getting ARP table from SNMP

Sam Stickland sam_mailinglists at spacething.org
Wed Oct 18 04:30:07 EDT 2006


Guys,

I'm surprised at how many people are writing their own scripts to do 
this - isn't one of the three virtues of a programmer meant to be 
Laziness? (see Lary Wall).

Netdisco does a superb job of walking all the MAC/CAM and ARP tables 
(for, example IP address to switch port resolution), storing it all in a 
database, providing a nice web front-end to it and much more - all via 
SNMP and CDP discovery. I've personally found it very useful to be able 
to ask questions like, "show me all the ports with multiple MAC 
addresses but no CDP entry", or "show me all ports with a CDP neighbor 
entry that can't be SNMP walked". It's amazing how many weird or 
forgotten bits of network you can discover.

http://netdisco.org/

(From my own laziness perspective it's better for me to have more people 
using and contributing to it ;) )

Sam

Bill Nash wrote:
> On Tue, 17 Oct 2006, Laurent Geyer wrote:
>   
>> Exactly what I'm doing. I don't have the CAM portion of it finished just yet
>> but I'm getting there. Too much ops crap to deal with right now to finish
>> what I started :(
>>
>> Mind sharing what you have?
>>
>>     
> I sent this to Laurent earlier, but I'll repost here because it's 
> interesting. 
>
> Caveats: 
> - This code is old. I wrote this about five years ago. It's also 
> for CatOS only. If it doesn't work out of the box, well, congratulations, 
> you have broken code. I coded for readability over cleverness. Sorry.
> - Pasting it into Pine makes it look like Prince Charles. It mostly only 
> affects the comments.
> - Database inserts are a problem that aren't addressed by this code. I 
> officially declare it to be 'your problem.'
>
> This can be modified to work with IOS. For all object fetches besides the 
> initial ifDescr poll, you need to instantiate a new session on a per vlan 
> basis, which means you'll have to poll a list of vlans from somewhere, or 
> glean them from the ifDescr strings with regexp. I don't know why Cisco 
> did this, but needless to say, it pisses me off:
>   
SNIP


More information about the cisco-nsp mailing list