Friday, March 20, 2020

Making sense of ENTITY-MIB::entPhysicalTable

I am improving my switch management web application. One part of that is improving handling of hardware information. For modular switches I need to get list of linecards. That's what ENTITY-MIB is for. My current code parses the value of entPhysicalName, which looks like this (Cat6800 VSS cluster, each node with three linecards):

ENTITY-MIB::entPhysicalName.3000 = STRING: Chassis 1 5 ENTITY-MIB::entPhysicalName.4000 = STRING: Chassis 1 1 ENTITY-MIB::entPhysicalName.5000 = STRING: Chassis 1 3 ENTITY-MIB::entPhysicalName.6000 = STRING: Chassis 2 5 ENTITY-MIB::entPhysicalName.7000 = STRING: Chassis 2 1 ENTITY-MIB::entPhysicalName.8000 = STRING: Chassis 2 3 

Single Cat6500 looks like this:

ENTITY-MIB::entPhysicalName.1000 = STRING: 6 ENTITY-MIB::entPhysicalName.2000 = STRING: 7 ENTITY-MIB::entPhysicalName.3000 = STRING: 2 ENTITY-MIB::entPhysicalName.4000 = STRING: 8 ENTITY-MIB::entPhysicalName.5000 = STRING: 9 ENTITY-MIB::entPhysicalName.6000 = STRING: 3 ENTITY-MIB::entPhysicalName.7000 = STRING: 4 ENTITY-MIB::entPhysicalName.8000 = STRING: 5 ENTITY-MIB::entPhysicalName.9000 = STRING: 1 

Single Catalyst 9410R looks like this:

ENTITY-MIB::entPhysicalName.1000 = STRING: Slot 1 Linecard ENTITY-MIB::entPhysicalName.2000 = STRING: Slot 2 Linecard ENTITY-MIB::entPhysicalName.3000 = STRING: Slot 3 Linecard ENTITY-MIB::entPhysicalName.4000 = STRING: Slot 4 Linecard ENTITY-MIB::entPhysicalName.5000 = STRING: Slot 5 Supervisor ENTITY-MIB::entPhysicalName.7000 = STRING: Slot 7 Linecard ENTITY-MIB::entPhysicalName.8000 = STRING: Slot 8 Linecard ENTITY-MIB::entPhysicalName.9000 = STRING: Slot 9 Linecard ENTITY-MIB::entPhysicalName.10000 = STRING: Slot 10 Linecard 

As you see, there's variation even with one vendor. Therefore I started quite significant rewrite of the entity handling code to actually understand the entPhysicalTable interrelations, since that table is organized as an implicit tree by using entPhysContainedIn field. I have found, that all Cisco linecards follow the "chassis--container--module" pattern. The container's entPhysicalParentRelPos then gives the slot number, which is also the linecards number within the system. That in turn makes it possible to make sense of port names in form chassis/module/port. I have implemented this and everything looked fine. Well, until I ran my code on the 9410R...

1. chassis=1 slot=1 idx=1000 name="Slot 1 Linecard" 2. chassis=1 slot=2 idx=2000 name="Slot 2 Linecard" 3. chassis=1 slot=3 idx=3000 name="Slot 3 Linecard" 4. chassis=1 slot=11 idx=5000 name="Slot 5 Supervisor" 5. chassis=1 slot=7 idx=7000 name="Slot 7 Linecard" 6. chassis=1 slot=8 idx=8000 name="Slot 8 Linecard" 7. chassis=1 slot=9 idx=9000 name="Slot 9 Linecard" 8. chassis=1 slot=10 idx=10000 name="Slot 10 Linecard" 

I guess you can see it. The supervisor is presented to user as being in slot 5, all the ports on it are 5/n -- but it's presented as being 11th container in the chassis according to ENTITY-MIB, breaking the pattern. FML.

It looks like there's no generic way of getting the linecard numbering without special-casing stuff even if we limit ourselves to Cisco. Or is there? I'd definitely like to know.



No comments:

Post a Comment