SNMP Sending Wrong

I tried reaching out to Mikrotik support, but its been 2 weeks with no response. I also searched this forum for any relevant cases to this. I’d even be happy to pay someone to fix this for us.

We have an issue with our CRS354 switch in which it is not sending SNMP data correctly. It is sending the wrong Integer (port number) for interfaces (see attached)

Here is an example with “ether14” port, which has index 28.
root@easydcim:~# snmpwalk -v2c -cSoladrive123 66.xxx.xxx.xxx1.3.6.1.2.1.2.2.1.2.28
iso.3.6.1.2.1.2.2.1.2.28 = STRING: “ether14”
root@easydcim:~# snmpwalk -v2c -cSoladrive123 66.xxx.xxx.xxx 1.3.6.1.2.1.2.2.1.1.28
iso.3.6.1.2.1.2.2.1.1.28 = INTEGER: 28

This is causing our EasyDCIm to get the wrong port number for these interfaces as seen in the attached image. On our other switches the integer number matches the interface or STRING number.

Switch Model: CRS354-48G-4S+2Q+
Switch Firmware: 7.15.2
Screenshot_3.png
Screenshot_2.png
07ae25ce8be390a56ed28c2823eb140d.png
Screenshot_4.png

Port number is yet another variable. So I wonder what exactly seems to be the problem?

The ifIndex should in an integer and description is a string – that part is right.

What’s confusing is that an interface SNMP ifIndex is the “.id” field in the config – NOT the “port number”. You can see this if you use:

/interface/print oid show-ids



*B2 >
name=.1.3.6.1.2.1.2.2.1.2.> 178 >
actual-mtu=.1.3.6.1.2.1.2.2.1.4.178
mac-address=.1.3.6.1.2.1.2.2.1.6.178
admin-status=.1.3.6.1.2.1.2.2.1.7.178
oper-status=.1.3.6.1.2.1.2.2.1.8.178
bytes-in=.1.3.6.1.2.1.31.1.1.1.6.178
packets-in=.1.3.6.1.2.1.31.1.1.1.7.178
discards-in=.1.3.6.1.2.1.2.2.1.13.178
errors-in=.1.3.6.1.2.1.2.2.1.14.178
bytes-out=.1.3.6.1.2.1.31.1.1.1.10.178
packets-out=.1.3.6.1.2.1.31.1.1.1.11.178
discards-out=.1.3.6.1.2.1.2.2.1.19.178
errors-out=.1.3.6.1.2.1.2.2.1.20.178

Since the ifIndex is tied to RouterOS item’s .id field (see above *B2 is the .id for an /interface, B2 is hex, so it becomes 178 in decimal/integer, and the .id is determined when an interface is added.

So the order interfaces are added to the config will effect the “port number” (i.e. ifIndex) you’ll see in SNMP. Thus if you remove and the re-add the same interface, it will get a new OID since it has a new .id in the configuration. Or, if the SFP ports are added first, then they be at ifIndex 1 and the starting ifIndex for ethernet be # of SFP ports + 1.

Basically ifIndex is NOT the port number in the sense of if you have ether3, it may or may not be 3 (or even 2) since it’s really the order that things are added to config that can effect SNMP indexes.