bharathi26 / e-napalm

A web interface to Netmiko and NAPALM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

eNAPALM is a web interface for NAPALM and Netmiko. It allows to send scripts (plain text script or Jinja2 templates along with a YAML file) to one or more devices using netmiko or NAPALM, and to retrieve and store the output of NAPALM getters.

It also includes a daemon, implemented with APScheduler, for the user to retrieve NAPALM getters on a regular basis (every hour, every day, etc) or to send a script at a given point in time.

eNAPALM is implemented with Flask, Bootstrap, jQuery, SQL Alchemy (database) and AP Scheduler (crontab-like functionnalities).

eNAPALM

Getting started

In order to start the website, you need to run app.py

python app.py

You can then access the website at http://IP:5100 where IP is the IP address of the server (or http://127.0.0.1:5100 if you are running it locally).

How to

Device management

The first step is to create "devices". A device is defined by its hostname, IP address and operating system. The left-side panel allows creating devices one by one by entering those parameters manually. Devices can also be created by importing an Excel file (.xls or .xlsx) (CSV import will be implemented later).

Device management

The device tab also includes a summary of all devices that have been created so far:

List of all devices

NAPALM Configuration

The NAPALM configuration webpage allows the user to change the configuration of one or more devices by using NAPALM functions: load_merge, load_replace, commit, discard and rollback. The user has to select a transport protocol and enters its credentials (username, password and secret password if needed). The script can also be a Jinja2 template, in which case a YAML file has to be imported to turn the J2 template into a real script.

In the right-side panel, it is possible to schedule the time when the script will be sent to the device(s). If left blank, the script will be sent immediately.

NAPALM Configuration

See NAPALM tutorial for more information about those functions.

NAPALM Getters

The user can choose a device and a set of getters. The query will be sent to the device and the output displayed in the middle panel.

The getters output can also be retrieved and stored on the server periodically, by selecting a frequency in the right-side panel. The output will be stored in the 'getters' folder of the application. If left blank, the getters will be retrieved immediately and the ouput display in the panel in the middle.

NAPALM Getters

More information about getters in NAPALM tutorial.

Netmiko

The netmiko page provides an interface to Netmiko. The user select a driver and target devices, enters its credentials (username, password and secret password if needed), and sets the port and the global delay factor (default: 8022, 1). Just like for NAPALM, the script can be a Jinja2 template (YAML file to be imported).

Netmiko

eNAPALM dependencies

eNAPALM relies on the following libraries:

  • NAPALM
  • netmiko
  • jinja2
  • pyYAML
  • flask
  • flask_sqlalchemy
  • flask_apscheduler
  • xlrd

Before using eNAPALM, you must make sure all these libraries are properly installed:

pip install napalm (dependencies: netmiko, jinja2, and pyYAML)
pip install flask_sqlalchemy (dependencies: flask)
pip install flask_apscheduler
pip install xlrd

or

pip install -r requirements.txt

Credits

NAPALM: A library that implements a set of functions to interact with different network device Operating Systems using a unified API.

Netmiko: A multi-vendor library to simplify Paramiko SSH connections to network devices.

Jinja2: A modern and designer-friendly templating language for Python.

xlrd: Library to extract data from Microsoft Excel (tm) spreadsheet files

Flask: Micro webdevelopment framework for Python.

SQLAlchemy: Python SQL toolkit and Object Relational Mapper

flask_apscheduler: Adds APScheduler (Advanced Python Scheduler) support to Flask

About

A web interface to Netmiko and NAPALM

License:MIT License


Languages

Language:Python 100.0%