Easy way to discover device model via SNMP ?

Hi,

I am writing a management software that would provide some basic info about the device, monitor some preconfigured variables etc. I was under the impression that detecting a device model would be as easy as doing an snmp query of a correct oid (entPhysicalModelName). Everything worked great for all of my cats: 2900, 3500, 2950, 3750 series, it worked great for 1760, 2801, 3745, 3825 routers. But when it came down to 7200 and 3600 series it was unable to detect the model. Doing an snmpget on entPhysicalModelName for 7200 returned an empty string, doing an snmpawlk on ..1.3.6.1.2.1.47.1.1.1.1.13 also gave no results. Ok, lets try entPhysicalName, still nothing, and finally entPhysicalDescr gave some usable results. With aironet APs even more trouble entPhysicalModelName.1 is set but all I can see there is garbage ? entPhysicalName is set correctly tough. The real question here is there an esay way (the one that would work for all cisco gear, well IOS based at least) to discover the device model using snmp ?

Reply to
Andrej Brkic
Loading thread data ...

In article , Andrej Brkic wrote: :I am writing a management software that would provide some :basic info about the device, monitor some preconfigured :variables etc. I was under the impression that detecting :a device model would be as easy as doing an snmp query :of a correct oid (entPhysicalModelName).

:The real :question here is there an esay way (the one that would work :for all cisco gear, well IOS based at least) to discover :the device model using snmp ?

No. There are several different major streams of what is called "IOS", and the methods are different for the different families.

You can get somewhere by parsing system.sysDescr.0 but I do not know how consistant that is.

Reply to
Walter Roberson

I have run in to this problem myself. The "fix" I found actually expanded the abilities of my "home grown" management system. I found that I needed some logic in the beginning to first find out what type of code the device was running. I would query several Oid's to get the version of code, then comapre that against a preset list so that my management software would know what Oid's to query next. I could then expand this to other devices, and not limit myself to just Cisco routers and switches. Eventually, I had a list of vendors and Oid's that worked pretty good. A bit more code, but much more flexible.

Reply to
brian.chirhart

I agree, in fact that was the same approach I used until I tried this against 1200 series aironet. It responded to right oid alright but the response was garbage. What I wanted was a relatively simple function for auto detection without having a "finger print" of every cisco device I wanted to detect. The approach was if it's running IOS, query some oids, and the first one that returns a non empty value should be used. This actually worked great for all but aironet AP's. But, I managed to resolve this with a bit of kludge. I am just curious why Cisco didn't implemet this the same way on all IOS streams (as Walter pointed out) ?

Reply to
Andrej Brkic

Andrej Brkic wrote in news: snipped-for-privacy@panj.fpz.hr:

If you grab the cisco-products-mib, you should have the complete list of sysOIDs (at least for the current product line). Then you can just do an snmpget of 1.3.6.1.2.1.1.2.0, and you'll get the sysOID. For instance, a

6509 is .1.3.6.1.4.1.9.1.283. But the trick is to automate it. Scripting the snmp part is rather easy, and using perl (and I'm not really a coder so if these seems clunky, it probably is), I would poll the sysOID object, do a split and strip out just the return. I would then pass the return through a hash built from the products MIB, to convert from the OID to an ascii description of the product family.

Of course, that's just one way of many to do this (if I really understand what you're trying to accomplish). Good luck,

c
Reply to
Chris Marva

Yes you understood what I want to do perfectly. In fact sysOID was my first choice until I found that some of my 3750s are identified as catalyst37xxStack insted of real model. One more thing is that it doesn't show if switch is SMI or EMI. At the moment I have the following setup: first check entPhysicalModelName (for which I have found is correctly set on all cats that I have around except for old 3524 boxes), then check entPhysicalName and entPhysicalDescr. If all that fails then check the sysOID. For now I have

100 % positive detection with this kind of setup (of course I didn't test it on all cisco HW out there).
Reply to
Andrej Brkic

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.