Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A web interface to NAPALM (and netmiko) #11

Open
afourmy opened this issue Nov 17, 2017 · 3 comments
Open

A web interface to NAPALM (and netmiko) #11

afourmy opened this issue Nov 17, 2017 · 3 comments

Comments

@afourmy
Copy link

afourmy commented Nov 17, 2017

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:

  • 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.

  • 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.

  • 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.

  • 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.

  • 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.

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 afourmy changed the title A web interface to NAPALM A web interface to NAPALM (and netmiko) Nov 17, 2017
@afourmy
Copy link
Author

afourmy commented Nov 19, 2017

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
Copy link
Member

This is super cool! :D

@arkadin-calvarez
Copy link

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants