This is a demo repository for an automation tool, which collects the operational data from network devices using NETCONF/YANG and visualise it in the way you need.
This tool allows you provide insights how you can draw any network topology you need for any vendor as long as the following conditions are met:
- Network devices supports NETCONF/YANG
- You have access to YANG modules or knows how to retrieve them from a network device via NETCONF
- You have some Python knowledge
Originally, the provided demo built physical network connectivity's topology between Cisco Nexus 9000 devices leveraging CDP and OSPF information. Later it was extended with furtehr vendors and topologies
- Nornir for managing interaction with devices in a threaded way
- NETCONF/YANG (using
scrapli_netconf
) for interacting with network devices network
andgraphviz
for building math graph and visualisation
- Install Python dependencies:
$ pip install -r requirements.txt
- Set the following environment variables:
$ export AUTOMATION_USERNAME='username_for_switches'
$ export AUTOMATION_PASSWORD='password_for_switches'
- Update inventory in
app/inventory
per standard Nornir inventory pattern. You can integrate it with NetBox or another source of truth, if needed. - Check how to specify topology:
$ cd app
$ python main.py --help
- Launch the script with arguments
--topology
to specify topology (e.g., OSPF or CDP) of choice and--format
(e.g. static or dymamic):
$ python main.py --topology cdp --format static
- Cisco NX-OS (tested with 9.3.9)
- Cisco IOS XR (testes with 7.2.1)
- Nokia SR OS (tested with 21.5.R1)
- CDP
- OSPF
- ISIS
- LLDP
static
leverages Graphviz to create static PNG image.dynamic
leverages VisJS/pyvis to create dynamic HTML pages.
This repository supports our blog Karneliuk.com. Find the corresponding blogposts explaing these files.
This is just a tiny example of what our students from Zero-to-Hero Network Automation Training can create to help them to do troubleshooting or real-time analysis. Enroll to the training today and start studying.
Contact us with your request and we will find the most suitable solution for you.
(c)2022, Karneliuk.com