Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SNMP Question

Status
Not open for further replies.

lyric0n

Technical User
Dec 28, 2005
74
Hey guys,

I have a few questions about getting SNMP information off of switches. I need to pull the MAC address and port it is located on, and I have a SNMP string which will do that (.1.3.6.1.2.1.17.4.3.1.2), but there is one problem I have with it. When I query the switch, I need to concatenate an '@VlanID' onto the community string, and it will give me information for that VLAN. If I leave nothing, it defaults to giving me VLAN 1. Is there an SNMP string which will give me all of the MAC/Port information, or a way I can reconstruct the community string to pass in all the VLAN ID's at once? Querying the switch for each VLAN ID takes too long...

Thanks,
Chris
 
This is going to give you more than you are looking for, but if you are familiar with Perl, get the cammer script from this page:

It will not only give you the mac address and port number that the device is attached to but also the vlan it is on, IP address, and dns name of the device.
 
Thanks. I looked at it and it does do a bit more than I was looking for. But I did notice that I only need to query the VLAN's on 2900 and 3500's and not every switch, implementing that helped out my code quite a bit.

Thanks for the post.
Chris
 
I've tweaked out the code a little bit so it will query more than just those models. I have it working for:
2900
3500
3550
3524
2950
3750
Supervisor 32 in 6500
Supervisor 2 in 6500
Supervisor 720 in 6500

It's an easy chance. Line 77 is looking for a specific word in the system description oid. Just have to add a |xxxx where xxxx = the model number in the system description.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top