Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computing > Cisco > Easy way to discover device model via SNMP ?

Reply
Thread Tools

Easy way to discover device model via SNMP ?

 
 
Andrej Brkic
Guest
Posts: n/a
 
      08-14-2005

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: http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      08-14-2005
In article <(E-Mail Removed)>,
Andrej Brkic <(E-Mail Removed)> 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
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
 
Reply With Quote
 
 
 
 
brian.chirhart@gmail.com
Guest
Posts: n/a
 
      08-15-2005
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 With Quote
 
Andrej Brkic
Guest
Posts: n/a
 
      08-15-2005
On 2005-08-15, (E-Mail Removed) <(E-Mail Removed)> 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: (E-Mail Removed)
 
Reply With Quote
 
Chris Marva
Guest
Posts: n/a
 
      08-19-2005
Andrej Brkic <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> On 2005-08-15, (E-Mail Removed) <(E-Mail Removed)>
> 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
 
Reply With Quote
 
Andrej Brkic
Guest
Posts: n/a
 
      08-21-2005
On 2005-08-19, Chris Marva <(E-Mail Removed)> wrote:
> Andrej Brkic <(E-Mail Removed)> wrote in
> news:(E-Mail Removed):
>
>> On 2005-08-15, (E-Mail Removed) <(E-Mail Removed)>
>> 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: (E-Mail Removed)
 
Reply With Quote
 
hadiyelmanish hadiyelmanish is offline
Junior Member
Join Date: Oct 2006
Posts: 1
 
      10-31-2006
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.!!
 
Reply With Quote
 
devilal devilal is offline
Junior Member
Join Date: Aug 2007
Posts: 1
 
      08-11-2007
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Determine the device is a router or switch given the Device IP via snmp KuttapanPro@gmail.com Cisco 0 11-05-2007 06:24 AM
Determining device type via SNMP Marco Shaw Cisco 1 10-03-2007 08:57 AM
SNMP module to query net-snmp milaus Perl Misc 3 08-31-2006 03:31 PM
Is there any way to discover what charset encoding a file is using? James Java 2 07-01-2004 08:06 AM
SNMP - Cisco - SNMP news.easynews.com Cisco 0 03-04-2004 10:44 PM



Advertisments