From d4c9927ec74e802dc31564bcb99e4ac49741cdb6 Mon Sep 17 00:00:00 2001 From: Paul Greenberg Date: Tue, 13 Oct 2020 20:41:31 -0400 Subject: [PATCH] update docs --- ndmtk/plugins/analytics/toolkit.py | 15 +++++++++------ utils/README.analytics.md | 21 +++++++++++++++++++++ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/ndmtk/plugins/analytics/toolkit.py b/ndmtk/plugins/analytics/toolkit.py index ff9c5cc..27e95bb 100644 --- a/ndmtk/plugins/analytics/toolkit.py +++ b/ndmtk/plugins/analytics/toolkit.py @@ -645,12 +645,15 @@ def get_ospf_neighbors_junos(self,fp): s = ' ' if part.count(':') == 1: s = ':' - j = part.index(s) - k = part[:j].strip().lower().replace(' ', '_') - v = part[j:].strip() - if part.count(':') == 1: - v = part[j+1:].strip() - neighbors[i][k] = v + try: + j = part.index(s) + k = part[:j].strip().lower().replace(' ', '_') + v = part[j:].strip() + if part.count(':') == 1: + v = part[j+1:].strip() + neighbors[i][k] = v + except: + pass continue self.log.info("unmatched line: %s" % (line)) return neighbors diff --git a/utils/README.analytics.md b/utils/README.analytics.md index d7e958a..aa8d371 100644 --- a/utils/README.analytics.md +++ b/utils/README.analytics.md @@ -19,10 +19,31 @@ utils/ndmtk-analytics -i ${NDMTK_SRC_DIR} --interface-props --format json -o ${N utils/ndmtk-analytics --edge-discovery \ --ip-interface-ref ${NDMTK_DST_DIR}/ip_interface.json \ --arp-table-ref ${NDMTK_DST_DIR}/arp_entries.json \ + --edge-node-ref ${NDMTK_DST_DIR}/registered_edge_nodes.json \ -o ${NDMTK_DST_DIR}/unregistered_edge_nodes.txt \ --format csv -l 2 ``` +The `registered_edge_nodes.json` file is in the following format: + +```json +[ + { + "name": "Verizon MPLS Network", + "networks": [ + "10.1.0.0/16" + ] + }, + { + "name": "AT&T MPLS Network", + "networks": [ + "10.2.0.0/16" + ] + } +] +``` + + Additionally, the same utility could be used to bulk upload the data to Elasticsearch: ```bash