GithubHelp home page GithubHelp logo

anbardirir / network-automation-scripts_python3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from twr14152/network-automation-scripts_python3

0.0 1.0 0.0 427 KB

Network automation using various python modules in Python3

Python 100.00%

network-automation-scripts_python3's Introduction

Network-Automation-Scripts using Python3

Libraries: Pyeapi, Netmiko, Napalm, Telnetlib, Restconf, Nxapi, Nornir, Netconf

This repository hold various automation scripts I've written over the years. My goal has been to use this as a repository for knowledge retention as well knowlege sharing. I plan to continue to grow this respository as long as I'm still doing stuff in the network automation space.

This has been a iterative learning process for me and I will be archiving or deleting scripts that no longer have value.

Nornir - TestDrive

  • Cisco IOS - GNS3 lab - nornir/using_netmiko_plugin
  • Arista Ceos lab - nornir/using_napalm_plugin
  • Testing newer version of Nornir, not backwards compatible with version 1.x

Netconf

  • Tested on Cisco DevNet Gear
  • Still learning not much here
  • netconf_ex1.py
  • netconf_get_conf.py

Nxapi

  • Found this api documentation to be lacking
  • Script examples I found were rigid and not very flexible
  • Created a script to allow user to enter any commands (config/show) w/o having to rewrite the script.
    • nxapi_script_ex1.py

Restconf

  • Still learning this api
  • restconf_ex1.py

Pyeapi - Python client for Arista eAPI

  • Cleaning up directory archived some scripts and created interactive script folder
  • Posted configs and validation scripts for ceos demo
  • Posted configs and validation from demo
  • hidden host config file, needs to be located in ~/.eapi.conf
  • created two sample scripts

Netmiko testing

  • Created a script to go out and automatically determine the device_type for a host_list or seedfile.
    • NetworkDiscovery/host_file_and_script/auto_detect_script.py
  • sample script to connect to juniper device
    • juniper_script1.py
    • juniper_conf_from_file.py
  • scp
    • file transfers to veos devices hosted using vagrant
    • file transfers to multiple devices using containerized eos or ceos
  • Network-Automation-Scripts_Python3/netmiko/NetworkDiscovery/host_file_and_script/
    • ios_discovery_script.py
    • host_file.txt
  • Added 3 examples of how to use jinja templates with netmiko
  • conf_bgp_r4_r5_using_class_obj. - uses class object to populate template
  • conf_bgp_r4_r5_using_dict.py - uses dictionaries to populate template
  • conf_bgp_yaml_jinja2.py - uses yaml files to populate a jinja2 template
  • Created new script that provide you a sandbox to say how many devices, what devices, and what to configure on each
    • ssh_sandbox.py
  • Created a very basic ssh script useful for discovery + updated with error handling
  • Created script that can handle multiple device with multiple unique configuration files
  • Added multiprocessing to speed up
    • netmiko_multi_dev_cfg.py
  • Added multiprocessing Pools to scripts to speed them up
    • netmiko_script5.py
    • netmiko_show_cmds.py
    • netmiko speed comparison between serial and multi-processing pools
  • netmiko_script#.py
  • capture output of scripts

Napalm for eos

  • /config_scripts/conf_merge
  • /config_scripts
  • Tested with ipython(python3.6) -> EOS_lab_Napalm_test_results
  • napalm_eos_script1.py

Napalm for cisco ios

  • napalm discovery script and post script
    • discovery_ios_svc_now.py
    • post_svc_now_rest_api.py
  • created a config_scripts directory added new script
    • script_config_ios.py
  • added new get_facts and get config script to directory
  • Testing with python3 napalm_base and napalm_ios
  • In my gns3 environment I'm using the following code
    • C7200-ADVENTERPRISEK9-M, Version 15.2(4)S7
    • IOS provides access to a subset of napalms features
    • EOS has been a more feature rich testbed with napalm

Telnetlib module

  • Use python3 telnetlib module
  • capture output of scripts

network-automation-scripts_python3's People

Contributors

twr14152 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.