I am having problems with SNMP interfaces indexes.
I’m making a script that periodically checks the status of some variables, including traffic on the physical interface “ether1”.
I have two identical RB1100x2, with the same version of RoS (6.15) with the original names of interface (“ether1”).
RB number one:
[root@RB1] > interface ethernet print
Flags: X - disabled, R - running, S - slave
# NAME MTU MAC-ADDRESS ARP
0 R ether1 1500 D4:CA:6D:E9:E9:31 enabled
1 R ether2 1500 D4:CA:6D:E9:E9:32 enabled
ether3 1500 D4:CA:6D:E9:E9:33 enabled
3 R ether4 1500 D4:CA:6D:E9:E9:34 enabled
4 R ether5 1500 D4:CA:6D:E9:E9:35 enabled
5 R ether6 1500 D4:CA:6D:E9:E9:36 enabled
6 R ether7 1500 D4:CA:6D:E9:E9:37 enabled
7 R ether8 1500 D4:CA:6D:E9:E9:38 enabled
8 R ether9 1500 D4:CA:6D:E9:E9:39 enabled
9 R ether10 1500 D4:CA:6D:E9:E9:3A enabled
10 ether11 1500 D4:CA:6D:E9:E9:3B enabled
11 ether12 1500 D4:CA:6D:E9:E9:3C enabled
12 R ether13 1500 D4:CA:6D:E9:E9:3D enabled
RB number two:
[root@RB2] > interface ethernet print
Flags: X - disabled, R - running, S - slave
# NAME MTU MAC-ADDRESS ARP
0 R ether1 1500 D4:CA:6D:E9:E8:E3 enabled
1 ether2 1500 D4:CA:6D:E9:E8:EF enabled
2 ether3 1500 D4:CA:6D:E9:E8:E5 enabled
3 ether4 1500 D4:CA:6D:E9:E8:E6 enabled
4 ether5 1500 D4:CA:6D:E9:E8:E7 enabled
5 R ether6 1500 D4:CA:6D:E9:E8:E8 enabled
6 R ether7 1500 D4:CA:6D:E9:E8:E9 enabled
7 ether8 1500 D4:CA:6D:E9:E8:EA enabled
8 ether9 1500 D4:CA:6D:E9:E8:EB enabled
9 ether10 1500 D4:CA:6D:E9:E8:EC enabled
10 ether11 1500 D4:CA:6D:E9:E8:ED enabled
11 ether12 1500 D4:CA:6D:E9:E8:EE enabled
12 R ether13 1500 D4:CA:6D:E9:E8:EF enabled
However, the indexes are different:
[root@RB1] > interface print oid
Flags: D - dynamic, X - disabled, R - running, S - slave
0 R name=.1.3.6.1.2.1.2.2.1.2.3 mtu=.1.3.6.1.2.1.2.2.1.4.3 mac-address=.1.3.6.1.2.1.2.2.1.6.3 admin-status=.1.3.6.1.2.1.2.2.1.7.3 oper-status=.1.3.6.1.2.1.2.2.1.8.3 bytes-in=.1.3.6.1.2.1.31.1.1.1.6.3 packets-in=.1.3.6.1.2.1.31.1.1.1.7.3 discards-in=.1.3.6.1.2.1.2.2.1.13.3 errors-in=.1.3.6.1.2.1.2.2.1.14.3 bytes-out=.1.3.6.1.2.1.31.1.1.1.10.3 packets-out=.1.3.6.1.2.1.31.1.1.1.11.3 discards-out=.1.3.6.1.2.1.2.2.1.19.3 errors-out=.1.3.6.1.2.1.2.2.1.20.3
root@RB2] > interface print oid
Flags: D - dynamic, X - disabled, R - running, S - slave
0 R name=.1.3.6.1.2.1.2.2.1.2.2 mtu=.1.3.6.1.2.1.2.2.1.4.2 mac-address=.1.3.6.1.2.1.2.2.1.6.2 admin-status=.1.3.6.1.2.1.2.2.1.7.2 oper-status=.1.3.6.1.2.1.2.2.1.8.2 bytes-in=.1.3.6.1.2.1.31.1.1.1.6.2 packets-in=.1.3.6.1.2.1.31.1.1.1.7.2 discards-in=.1.3.6.1.2.1.2.2.1.13.2 errors-in=.1.3.6.1.2.1.2.2.1.14.2 bytes-out=.1.3.6.1.2.1.31.1.1.1.10.2 packets-out=.1.3.6.1.2.1.31.1.1.1.11.2 discards-out=.1.3.6.1.2.1.2.2.1.19.2 errors-out=.1.3.6.1.2.1.2.2.1.20.2
I search in the forum for similar situations, but I found nothing with specific solution. Just the idea that the index depends on the name of the interface, but the idea here seems not to work.
Indexes need to be consistent because I need monitor 100 RBs with a only one script, only change IP.
Which condition can affect the index change?
PS: is there any way to get the transmitted and received bytes in an interface via API?
Greetings.