If by router vs. switch you mean whether or not a device is forwarding IP packets, then this can be determined by querying the ipForwarding object from the IP-MIB. If the device returns 1, then it is forwarding IP packets (i.e. the device is routing). If the object's value is 2, then it is not routing.
That said, many modern switches are capable of layer 3 switching, and will indicate that they are routing (because they are). Another method you could use is to get the cdpCacheCapabilities objects from a CDP neighbor of the device in question. If the value of the capabilities is 0x1 when logically OR'd with 0x1, then the device is a router.
You can use the CISCO-PRODUCTS-MIB to map sysObjectID to an object name (like you did for the 2621). Alternatively, sysDescr.0 usually tells you enough about the device type. sysObjectID is what is typically used by Network Management applications to obtain the device type.
I should clarify that other than the objects I have already said, there is no object that will return "router," "switch, "Access Point," etc. Most NMSes will take the sysObjectID and map it to a device type in order to poll platform-specific objects.
Thanks for reply. I have few questions. You mean that sysObjectID is the only way to find out particular device. right? If so then we should have database table for sysObjectIDs and known type for all types of devices. right? That we have have to get from CISCO-PRODUCTS-MIB. right?
If so then what should we do for other company's devices which is other than ciscoproducts?
And in sysdescr we do not get type of device, which is as follows,
SNMPv2-MIB::sysDescr.0 = STRING: "Cisco Internetwork Operating System Software
IOS (tm) C2600 Software (C2600-D-M), Version 12.0(7)T, RELEASE SOFTWARE (fc2)
Other vendors have their own MIBs to translate their sysObjectIDs. As for finding the device "type," this is nebulous as I have already said. That is, one device can be capable of being a router, switch, AP, firewall, etc. all at the same time. So, once you know the model name, you'd have to search the vendor's product or support site to get the capabilities.
This means we have to have database created for all types of devices and corresponding sysObjectIDs. Is any latest readymade list availabe? Or we have to do it by our own by geting product mib of all other companies.
We are pleased to announce availability of Beta software for 16.6.3.
16.6.3 will be the second rebuild on the 16.6 release train targeted
towards Catalyst 9500/9400/9300/3850/3650 switching platforms. We are
looking for early feedback from customers befor...
Introduction Featured Speakers Luis Espejel is the Telecommunications
Manager of IENova, an Oil & Gas company. Currently he works with Cisco
IOS® and Cisco IOS XE platforms, and NX to some extent. He has also
worked as a Senior Engineer with the Routing P...
In this session you can learn more about Layer 3 multicast and the best
practices to identify possible threats and take security measures. It
provides an overview of basic multicast, the best security practices for
use of this technology, and recommendati...