napalm-automation / hackathon-2017

Repo to share documents and track ideas for the hackathon
Apache License 2.0
0 stars 1 forks source link

A web interface to NAPALM (and netmiko) #11

Open afourmy opened 6 years ago

afourmy commented 6 years ago

I want to work on implementing a web interface to NAPALM (and netmiko too). It can be a showcase of napalm for network engineers who are not familiar with python / ansible.

What I will use: Flask, SQLalchemy, Bootstrap, jQuery and maybe some other javascript libraries if need be.

Main functionnalities:

the project will be available here: https://github.com/afourmy/e-napalm (I started two days ago as the whole things takes a few days)

Any comment / feedback / ideas on how to improve it or what else can be done is more than welcome !

Note: it won't be finished before Monday as I don't have access to my lab this we, which I need to test it on real devices.

afourmy commented 6 years ago

a web page to manage devices. Device = IP address + operating system + username + password (credentials to log in to the device) and optionally, hostname + secret password. A device can be created from a form manually, or by importing an excel file that contains those data, or by importing a .csv file. Devices can be deleted as well.

Done, except for the import of CSV. Devices can be created manually one by one or by excel import. (I'll add CSV support later). Besides, device = hostname + IP address + OS (napalm format, i.e ios, iosxr...). No password at this point.

a web page for sending script with netmiko The user can choose a driver, choose the global_delay_factor, and a protocol (SSH or telnet). Then, he writes the script in a text area and the script is sent to the device. A script can be a Jinja2 template, and it will be possible for the user to import a .yaml file to turn the j2 template into a real script.

Done. Should be working (I made some tests on ASR1K IOS). There's also a "port" textfield to choose a port different from the default one, but it's not considered yet.

a web page for napalm getters the user selects a device and one or more getters, the request is sent to the device and the result is displayed in the webinterface by pretty printing the dictionnary.

Done. Tested with ASR1K IOS, it was working.

a web page for napalm configuration functions just like with netmiko, the user can write a script (possibly a j2 template along with a yaml file) and send it to the device by using configure_merge or configure_replace. It will also be possible to rollback.

Done and tested, it works

a web page to configure a "napalm daemon", that will give the possibility to do certain things on a regular basis, for instance retrieve the configuration of the device every day, or retrieve a given set of getters every hour and store the result somewhere, that sort of things.

Done, but it's not a webpage on its own. Instead, it's a field in the napalm getters and in the napalm configuration pages. For the napalm getters, the data can be saved at regular intervals in a "getters" subfolder of this application, and for napalm configuration, an action can be configured at a given time in the future.

See readme: https://github.com/afourmy/e-napalm for more details

There is a lot of room for improvements, I added a few issues of the most important things that I could think of: https://github.com/afourmy/e-napalm/issues

dbarrosop commented 6 years ago

This is super cool! :D

arkadin-calvarez commented 4 years ago

This is really great indeed. I found this while looking for more information to create a simple HTTP --> Flask/Django --> Network devices application tool, where I can add devices and then create a quick view for the interface and BGP peering status with just one click. In one phrase, May you recommend me programs (Maybe the same above) to achieve that? Deeply grateful for any insight. :)