LITTLEBLACKDOG.COM Forum Index LITTLEBLACKDOG.COM

 
LWD LWD   FAQ FAQ   Memberlist Memberlist   Usergroups Usergroups   Active Topics Active Topics   Register Register  
  Profile Profile   Log in to check your private messages Log in to check your private messages   Log in Log in  
  Who is Online Who is Online   Image Gallery Image Gallery   Chat Chat   Search Search  
  LWDGear       LBDGear  

View next topic
View previous topic
Post new topic     Reply to topic   LITTLEBLACKDOG.COM Forum Index » Code Warriors
Author Message
Skookum
Butt Sniffer
Butt Sniffer


Joined: 26 Oct 2001
Posts: 1535
Location: I dunno, I lost my Mommy

Post Posted: Fri May 09, 2008 2:23 pm   Post subject: SNMP and Catalyst OS Reply with quote Back to top  

Alright this one is really aggravating me.

What I have done is I have taken a schematic of the building that I am in and numbered ever location that there is a telephone or a network jack. I have gone into the server room, and mapped every patch panel port to a switch port, and entered them into a database.
My end goal is that when someone clicks on a location number on the map it will pull up the live data as to who is sitting there at that time, and link that info back to SMS for the computer information.

Basically what I am doing is when they click a location, I query the location/patch table and pull out the patch number, then link that back to the Switch / Patch / Switch Port table and pull out the Switch and Switch port. I then run a SNMP Get command to query the switch for the MAC address. I then load that info into a temporary table so that I have historical data, or the switch doesn't have the information in the MAC table or the CAM table. I then use the MAC address and query the God-forsaken SMS database for the computer information.

This works beautifully with IOS. I mean I have a couple of minor bugs to work out, and to clean up my code, but it works.

But now that I am trying to query our two dirt old switches that are running CatOS I have ran into a problem. At first I was surprised to find that the CatOS switches had MAC info that I could pull through SNMP.
So I ran a SNMP Walk on the CatOS switches, and built my functions to pull the MAC addresses from the switch, depending on the port.
Everything works great until I get to the part of pulling the MAC address.

What is happening is I am getting an error that the OID does not exist. And I am able to get this error in 2 commercial applications, and 1 custom build application.

Here is some sample data to play with.
I am querying a Cisco 2948G Switch on Port 2/12. Since this is CatOS I have to add 64 to the port number, which gives me 76 (Just trust me on this one, CatOS is weird).
So what I do is an SNMP RealWalk pulling OID's and Values, and comparing them to the port that I have in my database.
Well I am able to successfully find the OID that matches port 76
.1.3.6.1.2.1.17.4.3.1.2.0.20.42.90.53.207 = 76

Now to pull the MAC address I need to change the 11th item in the OID to a 1. So I do some fancy parsing and then I get the OID of this
.1.3.6.1.2.1.17.4.3.1.1.0.20.42.90.53.207 = Hex: 00 14 2A 5A 35 CF

If I do an SNMPGet on .1.3.6.1.2.1.17.4.3.1.1.0.20.42.90.53.207 I get an error stating the OID does not exist. I have used Net-SNMP and iReasoning MIB Browser plus my own custom apps and they all say that the OID does not exist.

Now here is the kicker, if I do an SNMP walk on .1.3.6.1.2.1.17.4.3.1.1.0.20.42.90.53 it will pull up the OID of .1.3.6.1.2.1.17.4.3.1.1.0.20.42.90.53.207
This too happens in Net-SNMP, iReasoning MIB Browser, and my own custom apps.

So now I ask myself, WHY, OH WHY can't I pull that OID using SNMP Get?
The Walk shows it's there, it even has the Hex value of the MAC address, but I can't pull the value using SNMP Get. I am going crazy with trying to figure this out.

But now that I have written all of this out, I think that I figured out a way to code around it, but it will add a lot more time, and memory to my code. I think that I will just have to walk through the MAC OID's and pull the information, and then compare it to the previous Walk of the Port OID's, and what ever matches (minus the 11th item) will be the correct MAC address.

Any help or suggestions?

_________________
"Paranoia is no longer a mental illness it is a way of life" - Me
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic     Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
phpBB SEO
All times are GMT - 8 Hours

Help us keep advertisements off this site. Donate today!