[c-nsp] Nexus OIDs

Peter Rathlev peter at rathlev.dk
Mon Feb 27 14:40:24 EST 2017


On Mon, 2017-02-27 at 09:07 -0600, Mike Hammett wrote:
> I did an SNMPWalk of two of my Nexus switches looking for what has
> the model and serial numbers. I found several, sometimes with
> slightly different information. The MIBs on Cisco's site don't go
> down this far either. I was wondering if someone could point me as to
> the differences among them and\or which one would be "more standard"
> across product lines. 
> 
> iso.3.6.1.2.1.47.1.1.1.1.2.149 = STRING: "Nexus 3548 Chassis" 
> iso.3.6.1.2.1.47.1.1.1.1.7.149 = STRING: "Nexus 3548 Chassis" 
> iso.3.6.1.2.1.47.1.1.1.1.13.10 = STRING: "N3K-C3548P-10GX" 
> iso.3.6.1.2.1.47.1.1.1.1.13.22 = STRING: "N3K-C3548P-10GX" 
> iso.3.6.1.2.1.47.1.1.1.1.13.149 = STRING: "N3K-C3548P-10GX" 
> iso.3.6.1.2.1.47.1.1.1.1.11.10 = STRING: "[redacted]" 
> iso.3.6.1.2.1.47.1.1.1.1.11.149 = STRING: "[redacted]"
> 
> iso.3.6.1.2.1.47.1.1.1.1.2.149 = STRING: "N9K-C9396PX" 
> iso.3.6.1.2.1.47.1.1.1.1.7.149 = STRING: "N9K-C9396PX" 
> iso.3.6.1.2.1.47.1.1.1.1.13.10 = STRING: "N9K-C9396PX" 
> iso.3.6.1.2.1.47.1.1.1.1.13.22 = STRING: "N9K-C9396PX" 
> iso.3.6.1.2.1.47.1.1.1.1.13.149 = STRING: "N9K-C9396PX" 
> iso.3.6.1.2.1.47.1.1.1.1.11.10 = STRING: "[redacted]" 
> iso.3.6.1.2.1.47.1.1.1.1.11.22 = STRING: "[redacted]" 
> iso.3.6.1.2.1.47.1.1.1.1.11.149 = STRING: "[redacted]" 

As Lee mentions those are all in ENTITIY-MIB. The translated OIDs are:

  ENTITY-MIB::entPhysicalDescr.149 = STRING: "Nexus 3548 Chassis" 
  ENTITY-MIB::entPhysicalName.149 = STRING: "Nexus 3548 Chassis" 
  ENTITY-MIB::entPhysicalModelName.10 = STRING: "N3K-C3548P-10GX" 
  ENTITY-MIB::entPhysicalModelName.22 = STRING: "N3K-C3548P-10GX" 
  ENTITY-MIB::entPhysicalModelName.149 = STRING: "N3K-C3548P-10GX" 
  ENTITY-MIB::entPhysicalSerialNum.10 = STRING: "[redacted]" 
  ENTITY-MIB::entPhysicalSerialNum.149 = STRING: "[redacted]" 

  ENTITY-MIB::entPhysicalDescr.149 = STRING: "N9K-C9396PX" 
  ENTITY-MIB::entPhysicalName.149 = STRING: "N9K-C9396PX" 
  ENTITY-MIB::entPhysicalModelName.10 = STRING: "N9K-C9396PX" 
  ENTITY-MIB::entPhysicalModelName.22 = STRING: "N9K-C9396PX" 
  ENTITY-MIB::entPhysicalModelName.149 = STRING: "N9K-C9396PX"
  ENTITY-MIB::entPhysicalSerialNum.10 = STRING: "[redacted]" 
  ENTITY-MIB::entPhysicalSerialNum.22 = STRING: "[redacted]" 
  ENTITY-MIB::entPhysicalSerialNum.149 = STRING: "[redacted]" 

Make sure you have ENTITY-MIB installed. You can download it from CCO
(unfortunately requires logging in) here:

  http://snmp.cloudapps.cisco.com/Support/SNMP/do/BrowseMIB.do?local=en&step=2&submitClicked=true&mibName=ENTITY-MIB

Alternatively you can fetch it e.g. here:

  http://www.oidview.com/mibs/0/ENTITY-MIB.html

Make sure to get the dependencies too.

If you're looking for asset management and it's for fixed configuration
switches (like the 3548) and you want a single serial number it's
probably easiest to look at the chassis. ENTITY-MIB::entPhysicalClass
can tell you what the chassis is. From a WS-C3560CG-8PC-S:

$ snmpbulkwalk <options> <switch> ENTITY-MIB::entPhysicalClass
ENTITY-MIB::entPhysicalClass.1001 = INTEGER: chassis(3)
ENTITY-MIB::entPhysicalClass.1002 = INTEGER: module(9)
ENTITY-MIB::entPhysicalClass.1003 = INTEGER: powerSupply(6)
ENTITY-MIB::entPhysicalClass.1004 = INTEGER: sensor(8)
ENTITY-MIB::entPhysicalClass.1005 = INTEGER: port(10)
ENTITY-MIB::entPhysicalClass.1006 = INTEGER: port(10)
ENTITY-MIB::entPhysicalClass.1007 = INTEGER: port(10)
ENTITY-MIB::entPhysicalClass.1008 = INTEGER: port(10)
ENTITY-MIB::entPhysicalClass.1009 = INTEGER: port(10)
ENTITY-MIB::entPhysicalClass.1010 = INTEGER: port(10)
ENTITY-MIB::entPhysicalClass.1011 = INTEGER: port(10)
ENTITY-MIB::entPhysicalClass.1012 = INTEGER: port(10)
ENTITY-MIB::entPhysicalClass.1013 = INTEGER: container(5)
ENTITY-MIB::entPhysicalClass.1015 = INTEGER: container(5)
ENTITY-MIB::entPhysicalClass.1018 = INTEGER: port(10)
ENTITY-MIB::entPhysicalClass.1019 = INTEGER: port(10)

ENTITY-MIB::entPhysicalModelName will give you the model name and a
human readable description can be had from entPhysicalDescr. And
entPhysicalSerialNum is of course the serial number.

Another possibility is to look for entPhysicalContainedIn equal to 0,
meaning it isn't contained in anything. (Typically the physically
outermost object.)

You can get everything in a "neat" format with "snmptable", at least
with net-snmp-utils. Use "-Cf <char>" to get a CSV style list instead
of the whitespace aligned columns.

$ snmptable <options> -Cf , <switch> ENTITY-MIB::entPhysicalTable
SNMP table: ENTITY-MIB::entPhysicalTable

entPhysicalDescr,entPhysicalVendorType,entPhysicalContainedIn,entPhysicalClass,entPhysicalParentRelPos,entPhysicalName,entPhysicalHardwareRev,entPhysicalFirmwareRev,entPhysicalSoftwareRev,entPhysicalSerialNum,entPhysicalMfgName,entPhysicalModelName,entPhysicalAlias,entPhysicalAssetID,entPhysicalIsFRU,entPhysicalMfgDate,entPhysicalUris
WS-C3560CG-8PC-S,SNMPv2-SMI::enterprises.9.12.3.1.3.1015,0,chassis,-1,1,V02,15.0(2)SE,15.0(2)SE,SERIALNUM,,WS-C3560CG-8PC-S,,,false,?,?
WS-C3560CG-8PC-S - Fixed Module 0,SNMPv2-SMI::enterprises.9.12.3.1.9.56.26,1001,module,1,WS-C3560CG-8PC-S - Fixed Module 0,,,,,,,,,false,?,?
WS-C3560CG-8PC-S - Power Supply 0,SNMPv2-SMI::enterprises.9.12.3.1.6.189,1001,powerSupply,2,WS-C3560CG-8PC-S - Power Supply 0,,,,SERIALNUM,,,,,false,?,?
WS-C3560CG-8PC-S - Sensor 0,SNMPv2-SMI::enterprises.9.12.3.1.8.31,1001,sensor,3,WS-C3560CG-8PC-S - Sensor 0,,,,,,,,,false,?,?
GigabitEthernet0/1,SNMPv2-SMI::enterprises.9.12.3.1.10.150,1002,port,1,GigabitEthernet0/1,,,,,,,10101,,false,?,?
GigabitEthernet0/2,SNMPv2-SMI::enterprises.9.12.3.1.10.150,1002,port,2,GigabitEthernet0/2,,,,,,,10102,,false,?,?
GigabitEthernet0/3,SNMPv2-SMI::enterprises.9.12.3.1.10.150,1002,port,3,GigabitEthernet0/3,,,,,,,10103,,false,?,?
GigabitEthernet0/4,SNMPv2-SMI::enterprises.9.12.3.1.10.150,1002,port,4,GigabitEthernet0/4,,,,,,,10104,,false,?,?
GigabitEthernet0/5,SNMPv2-SMI::enterprises.9.12.3.1.10.150,1002,port,5,GigabitEthernet0/5,,,,,,,10105,,false,?,?
GigabitEthernet0/6,SNMPv2-SMI::enterprises.9.12.3.1.10.150,1002,port,6,GigabitEthernet0/6,,,,,,,10106,,false,?,?
GigabitEthernet0/7,SNMPv2-SMI::enterprises.9.12.3.1.10.150,1002,port,7,GigabitEthernet0/7,,,,,,,10107,,false,?,?
GigabitEthernet0/8,SNMPv2-SMI::enterprises.9.12.3.1.10.150,1002,port,8,GigabitEthernet0/8,,,,,,,10108,,false,?,?
GigabitEthernet Container,SNMPv2-SMI::enterprises.9.12.3.1.5.115,1002,container,9,GigabitEthernet0/9 Container,,,,,,,,,false,?,?
GigabitEthernet Container,SNMPv2-SMI::enterprises.9.12.3.1.5.115,1002,container,10,GigabitEthernet0/10 Container,,,,,,,,,false,?,?
GigabitEthernet0/10,SNMPv2-SMI::enterprises.9.12.3.1.10.150,1015,port,1,GigabitEthernet0/10,,,,,,,10110,,false,?,?
GigabitEthernet0/9,SNMPv2-SMI::enterprises.9.12.3.1.10.150,1013,port,1,GigabitEthernet0/9,,,,,,,10109,,false,?,?

FWIW here's a small bash script to output a tabulated summary of asset
informationer:

  http://ampere.rathlev.dk/asset-info

It's quite quick-and-dirty but maybe useful.

-- 
Peter



More information about the cisco-nsp mailing list