cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Auto web-based graphical check access to network devices

1292
Views
5
Helpful
0
Comments
cherifi.m85
Beginner

IS THERE AN ACCESS TO YOUR NETWORK DEVICES???

 

How To Exploiting Genie/pyATS, Flask, APScheduler and Diagrams to Validate/Monitor access to network devices??

 

I introduced previously the use case Validate/Monitor access to network devices with the integration of Genie/pyATS, WebEx Messenger and Syslog server which used later for the use case Efficient Network Devices Data Retrieving

Great! but what if we can use it to show the access graphically?! We love the graphical interface because it is very attractive and it does not lead to run the python script repeatedly since we use a scheduler!

 

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.
  1. 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
  2. On-demand Access : The admin can retrieve the actual topology access state of the devices using a botton.

Please refer to my GitHub Repo for the details how to install the dependencies and how to implement this project. Here the link: https://github.com/cherifimehdi/Graphical_Check_Access

Here the link to the Use Case from Cisco Automation Exchange: https://developer.cisco.com/network-automation/detail/560f7ec4-04e5-11ec-ab4f-8ee444196608/

 

Now to the DEMO

Here the same topology used previously:

Topology.png

 

Here we run the graphical_check_access.py script from the Admin host:

 

(Graphical_Check_Access) [mehdi@Graphical_Check_Access]$ python graphical_check_access.py

* Serving Flask app 'graphical_check_access' (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 615-503-771

 

CASE 1. Auto Access

We use index_auto_refresh_state.html template to automatically show the access state of the devices periodically.

Here a Demo!

 

CASE 2. On-demand Access

We use index_on-demand_state.html template to give the admin the possibility to retirive the access state of the devices using a botton.

Here a Demo!

 

Again, I hope you enjoyed it and found it helpful and useful! Comments and Suggestions are Welcome; Don't forget to rate it! Thank you for reading

Create
Recognize Your Peers
Content for Community-Ad