Giter Site home page Giter Site logo

ssh-automation-cisco's Introduction

Cisco Automation With Exscript & Python3

Used to automate finding/changing configuration on Cisco devices

Can be used for any device that supports ssh but purpose built for Cisco switches/routers

Getting Started

  1. You need python3, pip3, and exscript. If on Windows view "Using WSL 2 on Windows"

  2. Change 'hosts/hosts_file' to include the hosts to connect to

    • One host per line, no other formatting required
  3. To run the file

    • python3 cisco_cmd.py or ./cisco_cmd.py (Syntax below)
  4. Results are printed to console and appened to results.txt

    • Can send results to different file (Syntax below)

Syntax:

" " or ' ' are REQUIRED when using spaces

-o is NOT required

Help

./cisco_cmd.py -h, --help

List built-in commands

./cisco_cmd.py -b, --list-builtin

To run built-in commands

./cisco_cmd.py -c <built-in_command>, --cmd <built-in_command>

To run a custom command

./cisco_cmd.py -d <custom_command>, --custom <custom_command>

Optional user input filter for built-in commands

./cisco_cmd.py -c <built-in_command> -o <option>, ./cisco_cmd.py --cmd <built-in_command> --option <option>

To run modules & multiple commands

These modules are located in the "modules" directory. To see contents of file/module - cat <module_name>

./cisco_cmd.py -m <module_name>, --module <module_name>

To list the available modules

./cisco_cmd.py -l, --list-modules

Examples:

./cisco_cmd.py -c shmac -o abcd

./cisco_cmd.py -c shmactable

./cisco_cmd.py -c shintstatus -o '| in Gi1/0/1'

./cisco_cmd.py -c shint -o Gi1/0/1

./cisco_cmd.py -c shint -o 'Gi1/0/1 | in CRC'

./cisco_cmd.py -c shrun

./cisco_cmd.py -c shrun -o '| begin secret'

./cisco_cmd.py -d 'show vtp status | in trunk'

./cisco_cmd.py -d 'show run | begin trunk'

./cisco_cmd.py -m <name_of_module>

./cisco_cmd.py -m shmactableint

./cisco_cmd.py -m health

ToDo

Add templates for better interactions - https://exscript.readthedocs.io/en/latest/cli_tutorial.html#the-exscript-template-language

Add modules & built-in tasks

Printing results to another file on the fly

Fortiap Commands

https://praveenkumar4blog.wordpress.com/2017/01/18/how-to-check-why-fortiap-got-offline-from-fortigate/

reboot get system performance cfg -s fap-get-status cw_diag uptime cw_diag sys-performance iwconfig diag_debug_crashlog read cw_diag -c wtp-cfg cw_diag -c radio-cfg cw_diag -c vap-cfg cw_diag kernel-panic dmesg rcfg klog

ssh-automation-cisco's People

Contributors

3l1-23 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.