[HECnet] Mapping - getting close

Cory Smelosky b4 at gewt.net
Sat Jan 12 12:40:34 PST 2013


On 12 Jan 2013, at 14:01, Brian Hechinger <wonko at 4amlunch.net> wrote:

On 1/12/2013 8:17 AM, Cory Smelosky wrote:
On 12 Jan 2013, at 08:16, Brian Hechinger<wonko at 4amlunch.net>   wrote:

You need the new walking code. I'll send an email when I'm at my computer next.
Can I have a copy as well?   I won't do anything with it, but i'm just curious.


Here's the current version. This won't be the final version as it will need things like Cisco support added.

It dumps the data to pickle files. To read them just do something like this:

def load_data():
# Open pickle files
node_char_pkl = open('data/node_char.pkl', 'rb')
known_circ_pkl = open('data/known_circ.pkl', 'rb')
adj_nodes_pkl = open('data/adj_nodes.pkl', 'rb')
broken_nodes_pkl = open('data/broken_nodes.pkl', 'rb')

# Load pickled data
node_char = pickle.load(node_char_pkl)
known_circ = pickle.load(known_circ_pkl)
adj_nodes = pickle.load(adj_nodes_pkl)
broken_nodes = pickle.load(broken_nodes_pkl)

# Close pickle files
node_char_pkl.close()
known_circ_pkl.close()
adj_nodes_pkl.close()
broken_nodes_pkl.close()
#def load_data()

Data layout is as follows:

broken_nodes = set of nodes that doesn't answer to NCP

node_char = dictionary of dictionaries of the "show exec char" output. Primary index is node address. Secondary index is whatever is on the left hand side of the = in the output.

ex: node_char['1.13']['Identification'] = "RSX system at Update, Sweden"

one exception to this is node_char[address]['node_name'] which is the name as parsed out of the "Executor node" line.

known_circ = dictionary of dictionaries. Primary index is node queried, secondary index is circuit address.

adj_nodes = dictionary of dictionaries. Primary index is node queried, secondary index is adj node.

-brian
<collect_data.py>

I'm curious, how long does the script take to run?



More information about the Hecnet-list mailing list