Exploiting Genie/pyATS, Flask, APScheduler and Diagrams to Validate/Monitor access to network devices
This use case aims to generates automatically the topology of the entreprise showing if there is an access to the network devices. It leverages the modules Flask, APScheduler and Diagrams with Genie/pyATS framework.
In summary, this project :
-
The function Check_Access is scheduled in background with APScheduler and excecuted periodically in order to retrieve the actual topology access state of the devices.
-
A Flask route that retrieve and display the topology access state with legend indicating the access state according to the color : Red device in case No Access and Blue device in case Access Ok. There is two templates: Auto Access State and On demand Access State. In both cases, there is a GIF animation indicating that the topology access state is on process in the case that this latter is not previusly generated or deleted in some reason by the admin.
- Auto Access : Retrieve periodically the topology access state with auto refreshing the web page. Feel free to change the period time in index_auto_refresh_state.html
- On-demand Access : The admin can retrieve the actual topology access state of the devices using a botton.
Please refer to these white papers:
Getting started with pyATS Library Genie : Kickoff your Genie experience!
Welcome to Flask’s documentation
Here a blog post from Hank Preston in case of using CML2: How can I automate device configurations using CML2?
Cisco DevNet Sandbox Cisco Modeling Labs
How pyATS can be used as an end-to-end DevOps automation ecosystem: Accelerating your DevOps with pyATS