From 5b59645f5d376d06f3ff1e1e0bee8177b37b72ae Mon Sep 17 00:00:00 2001 From: Tr4sK Date: Tue, 1 Oct 2024 16:37:34 +0200 Subject: [PATCH] Gather vlan names from /interface vlan (#524) thanks! --- snmp/Routeros/LNMS_vlans.scr | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/snmp/Routeros/LNMS_vlans.scr b/snmp/Routeros/LNMS_vlans.scr index 3ac920ed5..dd12825de 100644 --- a/snmp/Routeros/LNMS_vlans.scr +++ b/snmp/Routeros/LNMS_vlans.scr @@ -9,13 +9,19 @@ :foreach i in [/interface bridge vlan find] do={ :local intf [/interface bridge vlan get $i bridge] :local vlid [/interface bridge vlan get $i vlan-ids] + :local vname + + :foreach i in [/interface vlan find where vlan-id=$vlid] do={ + :local intname [/interface vlan get $i name] + :set $vname ($intname) + } :foreach t in [/interface bridge vlan get $i tagged] do={ - :set $vlanst ($vlanst, "$vlid,$t") + :set $vlanst ($vlanst, "$vlid,$t,$vname") } :foreach u in [/interface bridge vlan get $i current-untagged] do={ - :set $vlansu ($vlansu, "$vlid,$u") + :set $vlansu ($vlansu, "$vlid,$u,$vname") } :foreach u in [/interface bridge port find where bridge=$intf and pvid=$vlid] do={ @@ -28,7 +34,7 @@ } } :if ( $fl != 1 ) do={ - :set $vlansu ($vlansu, "$vlid,$iu") + :set $vlansu ($vlansu, "$vlid,$iu,$vname") } } } @@ -36,6 +42,7 @@ :foreach vl in [/interface vlan find ] do={ :local intf [/interface vlan get $vl interface] :local vlid [/interface vlan get $vl vlan-id] + :local vname [/interface vlan get $vl name] :local fl 0 :foreach tmp in $vlanst do={ @@ -45,7 +52,7 @@ } } :if ( $fl != 1 ) do={ - :set $vlanst ($vlanst, "$vlid,$intf") + :set $vlanst ($vlanst, "$vlid,$intf,$vname") } }