opendcim / openDCIM

An open source (GPL v3) Data Center Inventory Management (DCIM) application.
http://opendcim.org
305 stars 205 forks source link

Switch SNMP does not work correctly when ifIndex of the interfaces are not ordered #938

Open heitormotta opened 7 years ago

heitormotta commented 7 years ago

When retrieving SNMP information from some chassis switches, the interfaces don't come ordered. Although the indexes are consistent between reboots, their value depend on the order that they appeared in the system for the first time.

This problem appeared when we added a Juniper EX9214 with multiple 40x1G cards to openDCIM. We created the chassis and populated the slots, and after choosing the first port of a card in a slot, openDCIM incorrectly retrieved names of interfaces that were on other slots. After some debugging with snmpwalk we found the problem. A partial list of the ifIndexes are pasted below, the slots populated where 0, 1 and 5.

Did anybody had a problem similar this? We managed to solve it by adding a function to reorder the interfaces retrieved in the SNMP functions of SwitchInfo.class.php.

> snmpwalk -v2c -c public 10.1.1.1 ifName

..... IF-MIB::ifName.531 = STRING: ge-0/0/7 IF-MIB::ifName.532 = STRING: ge-0/0/8 IF-MIB::ifName.533 = STRING: ge-0/0/9 IF-MIB::ifName.534 = STRING: ge-0/1/1 IF-MIB::ifName.535 = STRING: ge-0/1/2 IF-MIB::ifName.536 = STRING: ge-0/1/3 IF-MIB::ifName.537 = STRING: ge-0/1/4 IF-MIB::ifName.538 = STRING: ge-0/1/5 IF-MIB::ifName.539 = STRING: ge-0/1/6 IF-MIB::ifName.540 = STRING: ge-0/1/7 IF-MIB::ifName.541 = STRING: ge-0/1/8 IF-MIB::ifName.542 = STRING: ge-0/1/9 IF-MIB::ifName.543 = STRING: ge-0/1/0 IF-MIB::ifName.544 = STRING: ge-5/0/4 IF-MIB::ifName.545 = STRING: ge-5/0/5 IF-MIB::ifName.546 = STRING: ge-5/0/6 IF-MIB::ifName.547 = STRING: ge-5/0/7 IF-MIB::ifName.548 = STRING: ge-5/0/8 IF-MIB::ifName.549 = STRING: ge-5/0/9 IF-MIB::ifName.550 = STRING: ge-5/0/0 IF-MIB::ifName.551 = STRING: ge-5/0/1 IF-MIB::ifName.552 = STRING: ge-5/0/2 IF-MIB::ifName.553 = STRING: ge-5/0/3 IF-MIB::ifName.554 = STRING: ge-5/1/8 IF-MIB::ifName.555 = STRING: ge-5/1/9 IF-MIB::ifName.556 = STRING: ge-5/1/0 IF-MIB::ifName.557 = STRING: ge-5/1/1 IF-MIB::ifName.558 = STRING: ge-5/1/2 IF-MIB::ifName.559 = STRING: ge-5/1/3 IF-MIB::ifName.560 = STRING: ge-5/1/4 IF-MIB::ifName.561 = STRING: ge-5/1/5 IF-MIB::ifName.562 = STRING: ge-5/1/6 IF-MIB::ifName.563 = STRING: ge-5/1/7 IF-MIB::ifName.564 = STRING: ge-1/0/0 IF-MIB::ifName.565 = STRING: ge-1/0/1 IF-MIB::ifName.566 = STRING: ge-1/0/2 IF-MIB::ifName.567 = STRING: ge-1/0/3 IF-MIB::ifName.568 = STRING: ge-1/0/4 IF-MIB::ifName.569 = STRING: ge-1/0/5 IF-MIB::ifName.570 = STRING: ge-1/0/6 IF-MIB::ifName.571 = STRING: ge-1/0/7 IF-MIB::ifName.572 = STRING: ge-1/0/8 IF-MIB::ifName.573 = STRING: ge-1/0/9 IF-MIB::ifName.574 = STRING: ge-0/2/5 IF-MIB::ifName.575 = STRING: ge-0/2/6 IF-MIB::ifName.576 = STRING: ge-0/2/7 IF-MIB::ifName.577 = STRING: ge-0/2/8 IF-MIB::ifName.578 = STRING: ge-0/2/9 IF-MIB::ifName.579 = STRING: ge-0/2/0 IF-MIB::ifName.580 = STRING: ge-0/2/1 IF-MIB::ifName.581 = STRING: ge-0/2/2 IF-MIB::ifName.582 = STRING: ge-0/2/3 IF-MIB::ifName.583 = STRING: ge-0/2/4 IF-MIB::ifName.584 = STRING: ge-1/1/0 IF-MIB::ifName.585 = STRING: ge-1/1/1 IF-MIB::ifName.586 = STRING: ge-1/1/2 IF-MIB::ifName.587 = STRING: ge-1/1/3 IF-MIB::ifName.588 = STRING: ge-1/1/6 IF-MIB::ifName.589 = STRING: ge-1/1/4 IF-MIB::ifName.590 = STRING: ge-1/1/5 IF-MIB::ifName.591 = STRING: ge-1/1/7 IF-MIB::ifName.592 = STRING: ge-1/1/8 IF-MIB::ifName.593 = STRING: ge-1/1/9 ....

wilpig commented 7 years ago

This a known problem and a not going to be fixed under the current model. Yell at your hardware vendor to not do stupid things like this

ThomasADavis commented 7 years ago

You should see what a brocade VDX does with the this; also when yum cluster the switches, weird things happen.