Skip to content

Instantly share code, notes, and snippets.

@pdxmaverick
Created January 22, 2014 03:58
Show Gist options
  • Save pdxmaverick/8553262 to your computer and use it in GitHub Desktop.
Save pdxmaverick/8553262 to your computer and use it in GitHub Desktop.
update-l2-database.pl 7734a61
root@portal:/usr/local/ixp# /usr/local/bin/update-l2database.pl --debug --vlan 998
DEBUG: processing ptk-fabric-nwax-1
DEBUG: attempting to retrieve dot1qVlanFdbId mapping (.1.3.6.1.2.1.17.7.1.4.2.1.3) on ptk-fabric-nwax-1
DEBUG: that didn't work. let's try Juniper EX jnxExVlanTag mapping instead (.1.3.6.1.4.1.2636.3.40.1.5.1.5.1.5) on ptk-fabric-nwax-1
DEBUG: got mapping index: 998 maps to 2 on ptk-fabric-nwax-1
DEBUG: attempting Q-BRIDGE-MIB (.1.3.6.1.2.1.17.7.1.2.2.1.2.2) on ptk-fabric-nwax-1
DEBUG: processing ex4500
DEBUG: attempting to retrieve dot1qVlanFdbId mapping (.1.3.6.1.2.1.17.7.1.4.2.1.3) on ex4500
DEBUG: that didn't work. let's try Juniper EX jnxExVlanTag mapping instead (.1.3.6.1.4.1.2636.3.40.1.5.1.5.1.5) on ex4500
DEBUG: got mapping index: 998 maps to 2 on ex4500
DEBUG: attempting Q-BRIDGE-MIB (.1.3.6.1.2.1.17.7.1.2.2.1.2.2) on ex4500
$l2mapping = {
'ptk-fabric-nwax-1' => {
'ae0.0' => [
'5c5eabd6d878',
'0017cba415fc',
'0025642acb16',
'00121ec410db',
'5c5eab36330f',
'001907aa9c80',
'000c291617c3',
'88e0f37d79c1',
'001aa2ec8840',
'001b2af0fc00',
'00270dfdb600',
'001bedb1ce00',
'001b2116b130',
'88e0f3281e01',
'000c2962c867',
'001db5a08ff0',
'000c292adac8',
'0025903548f0',
'0014f68d301f',
'5c5eabd1d865',
'5c5eabdc7e79',
'001f12dafbf0',
'c46413c90320',
'0012f2f4a300',
'001e13e4f440',
'5c5eabd24278',
'88e0f37ac464',
'000d66edca66',
'001c57d2b884',
'00500b38b419',
'4055391ce9bb',
'00169c6c7d00',
'ac4bc84137cd',
'78fe3d0f70a4',
'001bede5c960',
'001de5aabc19'
]
},
'ex4500' => {
'ge-0/0/39.0' => [
'00d02b194100'
],
'ge-0/0/19.0' => [
'00500b38b419'
],
'ge-0/0/2.0' => [
'5c5eabdc7e79'
],
'ge-0/1/1.0' => [
'5c5eabd24278'
],
'ge-0/0/7.0' => [
'001bedb1ce00'
],
'ge-0/0/10.0' => [
'0017cba415fc'
],
'ge-0/2/2.0' => [
'000c291617c3',
'001b2af0fc00',
'000c2962c867',
'000c292adac8',
'0025903548f0'
],
'ge-0/0/36.0' => [
'f8c001d89488'
],
'xe-0/1/0.0' => [
'001aa2ec8840'
],
'ge-0/0/29.0' => [
'001c0f5c9840'
],
'ge-0/0/13.0' => [
'0025642acb16',
'001243640419'
],
'ge-0/0/38.0' => [
'001de5aabc19'
],
'ge-0/0/8.0' => [
'000b450a4800'
],
'ge-0/0/5.0' => [
'0014f68d301f'
],
'ge-0/0/28.0' => [
'000332af4c19'
],
'ge-0/0/17.0' => [
'5c5eabd6d878'
],
'ge-0/0/30.0' => [
'88e0f37ac464'
],
'ge-0/0/3.0' => [
'88e0f3281e01'
],
'ge-0/0/21.0' => [
'00121ec410db',
'00270cedfb81'
],
'ae23.0' => [
'001f12dafbf0'
],
'ge-0/0/34.0' => [
'88e0f37d79c1'
],
'ge-0/0/11.0' => [
'78fe3d0f70a4'
],
'ge-0/0/31.0' => [
'0012f2f4a300',
'001c57d2b884'
],
'ge-0/0/18.0' => [
'6c9ced29cccd'
],
'ge-0/0/32.0' => [
'0014f6f22c00'
],
'ge-0/0/20.0' => [
'001e13e4f440'
],
'ge-0/2/3.0' => [
'108ccf569340'
],
'ge-0/2/0.0' => [
'001b2116b130'
],
'ge-0/0/12.0' => [
'000d66edca66'
],
'ge-0/0/6.0' => [
'5c5eabd1d865'
],
'ge-0/0/22.0' => [
'0001638e5c00'
],
'ge-0/0/27.0' => [
'00169c6c7d00'
],
'ge-0/0/14.0' => [
'7c2064e6eccb'
],
'xe-0/0/26.0' => [
'4055391ce9bb'
],
'xe-0/0/4.0' => [
'5c5eab36330f'
],
'ae1.0' => [
'ac4bc84137cd'
],
'ge-0/0/25.0' => [
'c46413c90320'
],
'ge-0/1/3.0' => [
'001907aa9c80'
],
'xe-0/0/0.0' => [
'001db5a08ff0'
],
'xe-0/0/35.0' => [
'00270dfdb600'
],
'xe-0/0/15.0' => [
'10f3115162e5'
],
'ge-0/2/1.0' => [
'30f70d93bab1'
],
'xe-0/1/2.0' => [
'c46413ce8d30'
],
'xe-0/0/16.0' => [
'001bede5c960'
]
}
};
$ports = {
'ptk-fabric-nwax-1' => {
'xe-0/0/3' => {
'switchportid' => '134',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ptk-fabric-nwax-1',
'switchport' => 'xe-0/0/3',
'spifname' => 'xe-0/0/3',
'id' => '48'
},
'xe-0/0/2' => {
'switchportid' => '135',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ptk-fabric-nwax-1',
'switchport' => 'xe-0/0/2',
'spifname' => 'xe-0/0/2',
'id' => '47'
}
},
'ex4500' => {
'xe-0/0/26' => {
'switchportid' => '10',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'xe-0/0/26',
'spifname' => 'xe-0/0/26',
'id' => '25'
},
'ge-0/2/3' => {
'switchportid' => '24',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/2/3',
'spifname' => 'ge-0/2/3',
'id' => '44'
},
'xe-0/1/2' => {
'switchportid' => '57',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'xe-0/1/2',
'spifname' => 'xe-0/1/2',
'id' => '40'
},
'ge-0/0/25' => {
'switchportid' => '21',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/25',
'spifname' => 'ge-0/0/25',
'id' => '24'
},
'xe-0/0/0' => {
'switchportid' => '5',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'xe-0/0/0',
'spifname' => 'xe-0/0/0',
'id' => '2'
},
'ge-0/0/39' => {
'switchportid' => '22',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/39',
'spifname' => 'ge-0/0/39',
'id' => '37'
},
'ge-0/0/7' => {
'switchportid' => '38',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/7',
'spifname' => 'ge-0/0/7',
'id' => '7'
},
'xe-0/1/0' => {
'switchportid' => '58',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'xe-0/1/0',
'spifname' => 'xe-0/1/0',
'id' => '38'
},
'ge-0/0/23' => {
'switchportid' => '16',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/23',
'spifname' => 'ge-0/0/23',
'id' => '23'
},
'ge-0/0/28' => {
'switchportid' => '35',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/28',
'spifname' => 'ge-0/0/28',
'id' => '27'
},
'xe-0/0/33' => {
'switchportid' => '11',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'xe-0/0/33',
'spifname' => 'xe-0/0/33',
'id' => '32'
},
'xe-0/0/35' => {
'switchportid' => '56',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'xe-0/0/35',
'spifname' => 'xe-0/0/35',
'id' => '22'
},
'ge-0/2/1' => {
'switchportid' => '51',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/2/1',
'spifname' => 'ge-0/2/1',
'id' => '43'
},
'ge-0/0/17' => {
'switchportid' => '29',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/17',
'spifname' => 'ge-0/0/17',
'id' => '16'
},
'ge-0/0/18' => {
'switchportid' => '26',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/18',
'spifname' => 'ge-0/0/18',
'id' => '17'
},
'ge-0/0/27' => {
'switchportid' => '47',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/27',
'spifname' => 'ge-0/0/27',
'id' => '26'
},
'ge-0/0/5' => {
'switchportid' => '27',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/5',
'spifname' => 'ge-0/0/5',
'id' => '5'
},
'ge-0/0/9' => {
'switchportid' => '46',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/9',
'spifname' => 'ge-0/0/9',
'id' => '9'
},
'ge-0/0/19' => {
'switchportid' => '13',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/19',
'spifname' => 'ge-0/0/19',
'id' => '18'
},
'ge-0/0/21' => {
'switchportid' => '14',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/21',
'spifname' => 'ge-0/0/21',
'id' => '20'
},
'ge-0/1/3' => {
'switchportid' => '6',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/1/3',
'spifname' => 'ge-0/1/3',
'id' => '41'
},
'ge-0/0/22' => {
'switchportid' => '17',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/22',
'spifname' => 'ge-0/0/22',
'id' => '21'
},
'ge-0/0/24' => {
'switchportid' => '20',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/24',
'spifname' => 'ge-0/0/24',
'id' => '23'
},
'ge-0/0/13' => {
'switchportid' => '32',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/13',
'spifname' => 'ge-0/0/13',
'id' => '45'
},
'ge-0/0/31' => {
'switchportid' => '48',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/31',
'spifname' => 'ge-0/0/31',
'id' => '30'
},
'ge-0/0/12' => {
'switchportid' => '33',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/12',
'spifname' => 'ge-0/0/12',
'id' => '12'
},
'ge-0/0/30' => {
'switchportid' => '41',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/30',
'spifname' => 'ge-0/0/30',
'id' => '29'
},
'ge-0/0/8' => {
'switchportid' => '43',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/8',
'spifname' => 'ge-0/0/8',
'id' => '8'
},
'ge-0/0/38' => {
'switchportid' => '45',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/38',
'spifname' => 'ge-0/0/38',
'id' => '36'
},
'ge-0/0/36' => {
'switchportid' => '18',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/36',
'spifname' => 'ge-0/0/36',
'id' => '34'
},
'ge-0/0/6' => {
'switchportid' => '42',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/6',
'spifname' => 'ge-0/0/6',
'id' => '6'
},
'xe-0/0/15' => {
'switchportid' => '55',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'xe-0/0/15',
'spifname' => 'xe-0/0/15',
'id' => '14'
},
'ge-0/0/3' => {
'switchportid' => '44',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/3',
'spifname' => 'ge-0/0/3',
'id' => '3'
},
'ge-0/0/34' => {
'switchportid' => '39',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/34',
'spifname' => 'ge-0/0/34',
'id' => '33'
},
'ge-0/0/10' => {
'switchportid' => '34',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/10',
'spifname' => 'ge-0/0/10',
'id' => '10'
},
'ge-0/2/0' => {
'switchportid' => '52',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/2/0',
'spifname' => 'ge-0/2/0',
'id' => '42'
},
'xe-0/0/4' => {
'switchportid' => '7',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'xe-0/0/4',
'spifname' => 'xe-0/0/4',
'id' => '4'
},
'xe-0/0/16' => {
'switchportid' => '8',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'xe-0/0/16',
'spifname' => 'xe-0/0/16',
'id' => '15'
},
'ge-0/0/11' => {
'switchportid' => '36',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/11',
'spifname' => 'ge-0/0/11',
'id' => '11'
},
'ge-0/0/20' => {
'switchportid' => '15',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/20',
'spifname' => 'ge-0/0/20',
'id' => '19'
},
'ge-0/0/29' => {
'switchportid' => '25',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/29',
'spifname' => 'ge-0/0/29',
'id' => '28'
},
'xe-0/0/1' => {
'switchportid' => '59',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'xe-0/0/1',
'spifname' => 'xe-0/0/1',
'id' => '32'
},
'ge-0/0/14' => {
'switchportid' => '30',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/14',
'spifname' => 'ge-0/0/14',
'id' => '13'
},
'ge-0/0/2' => {
'switchportid' => '12',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/2',
'spifname' => 'ge-0/0/2',
'id' => '1'
},
'ge-0/1/1' => {
'switchportid' => '50',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/1/1',
'spifname' => 'ge-0/1/1',
'id' => '39'
},
'ge-0/0/32' => {
'switchportid' => '40',
'infrastructure' => '1',
'status' => '1',
'switch' => 'ex4500',
'switchport' => 'ge-0/0/32',
'spifname' => 'ge-0/0/32',
'id' => '31'
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment