Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to detect the type of a machine (switch,router...)using SNMP?

Status
Not open for further replies.

caro0530

Programmer
Jan 14, 2007
1
LB
Hi everyone,

I am working on a java GUI to set and get value on a machine using SNMP. I am using a range of ips, i am sending SNMP request to all ips to detect which machine (ip) is actually connected to the network and can use SNMP.
I need to know if the machine is a router, switch,printer,workstation (...)?. Is there any OID that can get me this info? Is there any other solution?

Thanks for your time!

 
sysObjectID is the best bet. The integer returned defines the device type. Problem is, you need to keep a list of the Integer to Router type updated. ... a static solution. I just wrote a script that returns the following

10.200.15.255 3745 12.2(15)T8
10.200.159.1 2621XM 12.3(20)
10.200.159.17 2621XM 12.3(20)
10.200.159.21 2621XM 12.2(26)
10.200.159.217 2610 12.0(14a)
10.200.159.221 1841 12.4(10a)
10.200.159.226 2621XM 12.2(12b)
10.200.159.227 2621XM 12.2(12b)
10.200.159.233 1841 12.4(10b)
10.200.159.241 1841 12.4(10a)
10.200.159.245 2610 12.0(14a)
 
There are many places that one can look to determine what type of device you are handling, and even then it may be swag if the host device is really what you think it is. sysObj, sysDesc, sysService, in addition to the mfgs enterprise section will assist. You may want to create a confidence metric to tell you how close of a match you have found. The problem is that an O/S is typically not tied to a machine class. For instance, Win CE can be run on a printer. OID 1.3.6.1.2.1.43 can be checked for printers.

Bottom line, short of a forensic sudy of many OID's, there is no one method to classify a device across a heterogeneous network.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top