Hi all,
V0.2 pushed to git , new things included
- A network weathermap with errors
- A network weathermap with latency , and SPF calculation with total latency along the path
- What if Topology , a basic what if model , change the isis link metric and display it in the model. No link/node remove for now.
- ISIS XR support ( just for links using screen parsing ... while netconf is ready )
- model demand based on netflow
Still can't get proper screenshots but go ahead and clone it and make your own topology
git clone https://github.com/cpmarvin/lnetd.git
Model Demand:
Save layout:
Monday, 10 September 2018
Saturday, 3 March 2018
LnetD v0.1 - network inventory based on ISIS
Hi again,
Finally manage to find time and put all the code in an web application.
There are two project that i want to thank for offering all the tools required to build this.
https://github.com/afourmy/eNMS/
https://github.com/afourmy/flask-gentelella
Now back to the topology map and inventory based on ISIS.
- Login screen
- Dashboard
- Inventory
- D3js Topology and Map
As always code on github: https://github.com/cpmarvin/lnetd
Wednesday, 7 February 2018
Dijkstra - Networkx, d3.js weathermap based on ISIS topology
Based on previous posts the code is
extended with couple of new features.
First the parallel link algorithm is
enhanced using http://webiks.com/d3-js-force-layout-straight-parallel-links/ calculation, please see the link for more details. I have
parallel links support and 'half links' to support displaying in/out link
utilisation.
Same as before I'm using py ez to parse the
isis database from a juniper device. This creates a json with all the links in
the topology. The json also contains information about current 5 minutes
utilisation and snmp ifindex for each link.
The weathermap function is based on snmp
data collected by telegraf and stored in influxdb. The py ez script will
populate the json with information from influxdb. Basically for each link we
have the IP address, based on this we query influxdb to get the snmp ifindex.
Then I do a second query to get the last 5 minutes util and the link capacity.
The resulting json has the following
information:
Source, target, local ip, remote ip, util,
capacity, local_ip_remote_ip, ifindex.
[{"r_ip": "x.x.x.x",
"l_int": 49, "capacity": 10000, "target":
"PE1-CPT", "metric": "145",
"l_ip_r_ip": ["x.x.x.x", "y.y.y.y"],
"util": 1491081683, "source": "PE1-GSW",
"r_int": 0, "l_ip": "y.y.y.y"}
After the d3js topology is displayed,
clicking on an link will create a plotly graph with last 24h utilisation. This
is done via ajax query to the api. The request argument is host + ifindex. The
api will query influxdb and get the snmp information.
The last piece of the puzzle is the
dijkstra algorithm to find shortest path between nodes.
This is achieved using networkx python
library and works on top of flask. The js code sends a request with all links
array, source and destination. The api will return all links id for all ecmp
paths between nodes. Based on link Id d3js will colour the links with dotted
lines.
Demo time:
Topology:
Plotly graph on link click:
Dijkstra's spf between two nodes:
Code on https://github.com/cpmarvin/lnetd
Leave a message if you have a hard time
replicating this. This project started as a learning exercise and the code is
not very clean.
Subscribe to:
Posts (Atom)