From d4fbd021adf1d5ca97e23d960acd7af8bd1454a4 Mon Sep 17 00:00:00 2001 From: Tinashe Date: Wed, 22 Jan 2025 09:49:46 -0500 Subject: [PATCH] l2traceroute --- .../bin/{l2traceroute => nodel2traceroute} | 5 ++- confluent_client/doc/man/l2traceroute.ronn | 38 ----------------- .../doc/man/nodel2traceroute.ronn | 42 +++++++++++++++++++ 3 files changed, 46 insertions(+), 39 deletions(-) rename confluent_client/bin/{l2traceroute => nodel2traceroute} (98%) delete mode 100644 confluent_client/doc/man/l2traceroute.ronn create mode 100644 confluent_client/doc/man/nodel2traceroute.ronn diff --git a/confluent_client/bin/l2traceroute b/confluent_client/bin/nodel2traceroute similarity index 98% rename from confluent_client/bin/l2traceroute rename to confluent_client/bin/nodel2traceroute index e8f9705e..233f3cc8 100755 --- a/confluent_client/bin/l2traceroute +++ b/confluent_client/bin/nodel2traceroute @@ -61,7 +61,10 @@ def get_neighbors(switch): switch_neigbors = [] url = '/networking/neighbors/by-switch/{0}/by-peername/'.format(switch) for neighbor in session.read(url): - switch = neighbor['item']['href'].strip('/') + try: + switch = neighbor['item']['href'].strip('/') + except: + continue if switch in all_switches: switch_neigbors.append(switch) return switch_neigbors diff --git a/confluent_client/doc/man/l2traceroute.ronn b/confluent_client/doc/man/l2traceroute.ronn deleted file mode 100644 index 16318567..00000000 --- a/confluent_client/doc/man/l2traceroute.ronn +++ /dev/null @@ -1,38 +0,0 @@ -l2traceroute(8) -- returns the layer 2 route through an Ethernet network managed by confluent given 2 end points. -============================== -## SYNOPSIS -`l2traceroute [options] ` - -## DESCRIPTION -**l2traceroute** is a command that returns the layer 2 route for the configered interfaces in nodeattrib. -It can also be used with the -i and -e options to check against specific interfaces on the endpoints. - - -## PREREQUISITES -**l2traceroute** the net..switch attributes have to be set on the end points if endpoint is not a switch - - -## OPTIONS -* ` -e` EFACE, --eface=INTERFACE - interface to check against for the second end point -* ` -i` INTERFACE, --interface=INTERFACE - interface to check against for the first end point -* ` -c` CUMULUS, --cumulus=CUMULUS - return layer 2 route through cumulus switches only -* `-h`, `--help`: - Show help message and exit - - -## EXAMPLES - * Checking route between two nodes: - `# l2traceroute_client n244 n1851` - `n244 to n1851: ['switch114']` - -* Checking route from one node to multiple nodes: - `# l2traceroute_client n244 n1833,n1851` - `n244 to n1833: ['switch114', 'switch7', 'switch32', 'switch253', 'switch85', 'switch72', 'switch21', 'switch2', 'switch96', 'switch103', 'switch115'] - n244 to n1851: ['switch114']` - - - - diff --git a/confluent_client/doc/man/nodel2traceroute.ronn b/confluent_client/doc/man/nodel2traceroute.ronn new file mode 100644 index 00000000..a5a1a428 --- /dev/null +++ b/confluent_client/doc/man/nodel2traceroute.ronn @@ -0,0 +1,42 @@ +nodel2traceroute(8) -- returns the layer 2 route through an Ethernet network managed by confluent given 2 end points. +============================== +## SYNOPSIS +`nodel2traceroute [options] ` + +## DESCRIPTION +**nodel2traceroute** is a command that returns the layer 2 route for the configered interfaces in nodeattrib. +It can also be used with the -i and -e options to check against specific interfaces on the endpoints. If the +--interface or --eface option are not used then the command will check for routes against all the defined +interfaces in nodeattrib (net.*.switch) for the nodes. + + + +## PREREQUISITES +**nodel2traceroute** the net..switch attributes have to be set on the end points if endpoint is not a switch + + +## OPTIONS +* ` -e` EFACE, --eface=INTERFACE + interface to check against for the second end point or end points if using checking against multiple nodes +* ` -i` INTERFACE, --interface=INTERFACE + interface to check against for the first end point +* ` -c` CUMULUS, --cumulus=CUMULUS + return layer 2 route through cumulus switches only +* `-h`, `--help`: + Show help message and exit + + +## EXAMPLES + * Checking route between two nodes: + `# nodel2traceroute n244 n1851` + `n244 to n1851: ['switch114']` + +* Checking route from one node to multiple nodes: + `# nodel2traceroute n244 n1833,n1851` + `n244 to n1833: ['switch114', 'switch7', 'switch32', 'switch253', 'switch85', 'switch72', 'switch21', 'switch2', 'switch96', 'switch103', 'switch115'] + n244 to n1851: ['switch114']` + + + + +