How to find the serial number of an edge core device using SNMP OID
SNMP (Simple Network Management Protocol) is a protocol that allows network administrators to monitor and manage network devices such as routers, switches, servers, printers, etc. SNMP uses a hierarchical structure of objects called OIDs (Object Identifiers) to represent different aspects of a device's status and configuration.
One of the OIDs that can be useful for inventory purposes is the entPhysicalSerialNum OID, which returns the serial number of a physical component of a device. This OID is part of the ENTITY-MIB, which defines information about physical entities associated with network devices.
In this article, we will show you how to use SNMP to find the serial number of an edge core device, such as an Aruba 2930M switch. We will use the following tools:
An edge core device with SNMP enabled and configured with a community string (we will use \"public\" as an example)
A computer with an SNMP client software (we will use Net-SNMP as an example)
A MIB browser software (we will use iReasoning MIB Browser as an example)
Step 1: Find the OID for entPhysicalSerialNum
The first step is to find the OID for the entPhysicalSerialNum object. We can use a MIB browser software to load the ENTITY-MIB and browse its contents. Alternatively, we can use an online MIB repository such as OID Repository or Object Identifier Repository to search for the object name.
In this example, we will use iReasoning MIB Browser to load the ENTITY-MIB from a local file. After loading the MIB, we can search for the entPhysicalSerialNum object and see its details. The OID for this object is .18.104.22.168.22.214.171.124.126.96.36.199, as shown in the screenshot below:
Step 2: Find the index for each physical component
The next step is to find the index for each physical component of the edge core device that has a serial number. The index is a sub-identifier that follows the entPhysicalSerialNum OID and identifies a specific instance of the object. For example, .188.8.131.52.184.108.40.206.220.127.116.11.114001 means the serial number of the physical component with index 114001.
To find the index for each physical component, we can use an SNMP client software to perform an SNMP walk on the entPhysicalSerialNum OID and see what values are returned. An SNMP walk is a method of querying multiple OIDs in a subtree by sending multiple SNMP get requests.
In this example, we will use Net-SNMP to perform an SNMP walk on the edge core device with IP address 192.168.4.99 and community string \"public\". The command is:
snmpwalk -v1 -c public 192.168.4.99 .18.104.22.168.22.214.171.124.126.96.36.199
The output of this command will show us the OIDs and values for each physical component that has a serial number, as shown in the screenshot below:
As we can see, there are six physical components with serial numbers: two power supplies for each member of a three-member stack of switches (member 1: PS1 and PS2, member 2: PS1 and PS2, c481cea774