Easy way to discover device model via SNMP ?

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

  1. Andrej Brkic

    Andrej Brkic Guest

    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 ?


    --
    Andrej Brkic
    E-mail:
     
    Andrej Brkic, Aug 14, 2005
    #1
    1. Advertising

  2. 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
    :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.
    --
    "This was a Golden Age, a time of high adventure, rich living and
    hard dying... but nobody thought so." -- Alfred Bester, TSMD
     
    Walter Roberson, Aug 15, 2005
    #2
    1. Advertising

  3. Andrej Brkic

    Guest

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

    Andrej Brkic Guest

    On 2005-08-15, <> wrote:
    > 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.
    >


    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
    E-mail:
     
    Andrej Brkic, Aug 15, 2005
    #4
  5. Andrej Brkic

    Chris Marva Guest

    Andrej Brkic <> wrote in
    news::

    > On 2005-08-15, <>
    > wrote:
    >> 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.
    >>

    >
    > 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) ?
    >
    >


    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
     
    Chris Marva, Aug 19, 2005
    #5
  6. Andrej Brkic

    Andrej Brkic Guest

    On 2005-08-19, Chris Marva <> wrote:
    > Andrej Brkic <> wrote in
    > news::
    >
    >> On 2005-08-15, <>
    >> wrote:
    >>> 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.
    >>>

    >>
    >> 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) ?
    >>
    >>

    >
    > 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


    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
    E-mail:
     
    Andrej Brkic, Aug 21, 2005
    #6
  7. Andrej Brkic

    hadiyelmanish

    Joined:
    Oct 31, 2006
    Messages:
    1
    Hi..

    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
    #7
  8. Andrej Brkic

    devilal

    Joined:
    Aug 11, 2007
    Messages:
    1
    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 1.3.6.1.4.1.2682.1 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.


    Thanks

    -
    Regards,
    Devilal
     
    devilal, Aug 11, 2007
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. news.easynews.com

    SNMP - Cisco - SNMP

    news.easynews.com, Mar 4, 2004, in forum: Cisco
    Replies:
    0
    Views:
    833
    news.easynews.com
    Mar 4, 2004
  2. Neil
    Replies:
    174
    Views:
    3,353
    Briscobar
    Apr 17, 2006
  3. John John

    AMD Opteron: 1-way, 2-way, ... Up to 8-way.

    John John, Dec 24, 2005, in forum: Windows 64bit
    Replies:
    12
    Views:
    829
    Tony Sperling
    Dec 27, 2005
  4. Marco Shaw

    Determining device type via SNMP

    Marco Shaw, Oct 2, 2007, in forum: Cisco
    Replies:
    1
    Views:
    1,963
    Alfred Nagl
    Oct 3, 2007
  5. Replies:
    0
    Views:
    967
Loading...

Share This Page