Easy way to discover device model via SNMP ?

Discussion in 'Cisco' started by Andrej Brkic, Aug 14, 2005.

  1. Andrej Brkic

    Andrej Brkic Guest


    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
    .. 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 ?
    Andrej Brkic, Aug 14, 2005
    1. Advertisements

  2. :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
    :eek:f 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.
    Walter Roberson, Aug 15, 2005
    1. Advertisements

  3. 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.
    brian.chirhart, Aug 15, 2005
  4. Andrej Brkic

    Andrej Brkic Guest

    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) ?
    Andrej Brkic, Aug 15, 2005
  5. Andrej Brkic

    Chris Marva Guest

    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, and you'll get the sysOID. For instance, a
    6509 is . 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,

    Chris Marva, Aug 19, 2005
  6. Andrej Brkic

    Andrej Brkic Guest

    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).
    Andrej Brkic, Aug 21, 2005
  7. Andrej Brkic


    Oct 31, 2006
    Likes Received:

    Hello sir,
    This is Maan..
    can u tell me how to get a name of layer 2 or 3 device in the network from
    a application.Im working on vb.net i m not getting any hint from 3 to 4 days
    m badly struct in this problem so if u can help me out..
    Thanks in ADVANCE.!!:veryprou:
    hadiyelmanish, Oct 31, 2006
  8. Andrej Brkic


    Aug 11, 2007
    Likes Received:
    SNMP Device Type and MIB file reading

    Hi All,

    I am a newbie to SNMP. I am developing an application which will discover all the devices on a network. User will get the MIB file for each network device. Application has to discover which device this particular MIB file has been download for (Application has MIB Browser code as well).

    From sysOID I get an enterprise ID (for eg. 311
    for Microsoft).
    For device type I have to traverse further (in more depth than 311). I
    have got device type in some of the MIB files(from Cisco and DPS
    Telecom) but I still have some questions. Please help me in finding
    the answers to these questions:

    1. Is there a specific depth at which I will get the product/device
    type OID ?
    I learned that in DPS telecom its is dpsAlarmControl (a
    device) so, the I can understand that the OID with depth one greater
    than the enterprise OID is the device type. But this is not same in
    other enterprises like Cisco.

    So, How do I know the OID corresponding to the product type in an MIB
    file ?
    Is there a rule of thumb for this?

    2. My most important job is to find the SNMP response from the device
    and get the information like manufacturer's name, device/ppoduct
    type. Then, I have to match the device type in the corresponding MIB file. So
    if it does not match then i will say unknown product type and if
    matches then I will return the product description from the MIB file.

    Manufacturer's name I am able to find.

    The biggest hurdle to me now is how do I get the product type or
    device type from SNMP response ??
    I am able to get the manufacturer name as I have the sysOID and I can
    get the enterprise ID (for eg. 311 for MS) and I look into IANA file
    and get Microsoft. This i am able to do as I know at which depth (or
    at which particular level I get the enterprise ID).

    Is there any method or a particular OID for knowing the product type
    from SNMP response ???

    3. How to link the Discovered Device with the MIB file? I mean that once I have the device type or the snmp response of the SNMP request, how do we choose the MIB file and find out that this is the MIB file for this device and link that MIB to that device.

    Plz help me.


    devilal, Aug 11, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.