Get VLAN list with SNMP from bridge interface

hi,

which OID is needed, to get the VLAN list and which port has which VLAN configured ? We need that information for our CMDB imports.

On the terminal, I can see them:

 /interface bridge vlan> print brief 
Flags: X - disabled, D - dynamic 
 #   BRIDGE                                                               VLAN-IDS  CURRENT-TAGGED                                                              CURRENT-UNTAGGED                                                             
 0   trunk                                                                101       sfp-sfpplus7                                                               
                                                                                    sfp-sfpplus15                                                              
                                                                                    sfp-sfpplus16                                                              
                                                                                    sfp-sfpplus1                                                               
...

cu denny

Use print oid

Have you tried it?
It does not work for any MT I have tested on

/interface bridge vlan
print oid
expected end of command (line 1 column 7)

Use:

/interface print oid

All OID will be displayed

Those prints are not really useful as they refer to “interfaces” (OP was asking about bridge-vlan), in addition, they don’t include OID for type of interface, neither the assignment to bridge.
For future reference, if someone needs it:
Type of interface is in tree 1.3.6.1.2.1.2.2.1.3 (vlan is value 135)
Index (unique number which can be refered from other OIDs) is in 1.3.6.1.2.1.2.2.1.1
Name (description) is in 1.3.6.1.2.1.2.2.1.2

Unfortunately, there is no OID for looking up interface assignment to bridge. It exists (1.3.6.1.2.1.17.1.4) but it is not implemented in RouterOS

However back to topic: OP was asking about bridge-vlan, therefore vlan filtering on bridge ports. This is unfortunately not implemented right now and as far as I know, there is not even standartized OID for it. Unless Mikrotik puts it in future version into their proprietary MIB, we can’t get it through SNMP

Only chance to solve this which comes into my mind is very specific way of naming interfaces so it will include interface name, bridge name and vlan number(s). Then you might use 1.3.6.1.2.1.2.2.1.2 and simply parse those names and figure out your config. however, that is very prone to mistakes as name does not necessarily represent real settings.

hi,

thanks for the response, but that is a bit sad. We have HP / Lancom / Ubiquity / Fortigate and all of them works in the way, that Jdisc (a scan tool, which we uses as import source for I-DOIT CMDB) has no problems to get all important things … but RouterOS brings me sometimes down, with SNMP related things.

Maybe .. it works in a few month … I should ask the support.

as I got the same request for viewing VLAN assignments in NetXMS, are there any news regarding this OID? On our Dlink switches and Cisco it´s working.
br
philipp