Giter VIP home page Giter VIP logo

switch's People

Contributors

ctomkow avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

dnsblah azuercher

switch's Issues

Add save paramenter

Currently it's impossible to save the configuration to the device
I figured with the netmiko that this works, at least on cisco_ios
dev.save_config(cmd="write", confirm=True)

Not sure how to implement it on your script to support other OS's but adding param args.saveConfig and before the dev.disconnect

if saveConfig:
    dev.save_config(cmd="write", confirm=True)

errors on CentOS 7.6

Hi Craig,
I'm trying to use your script to bulk edit cisco devices. When I run it i get the following errors and I'm unsure how to fix. Any ideas?

Thanks,
Aaron

]# python3 ./swITch.py -va auth.txt -i ip.list -s set-clock.cmd
Traceback (most recent call last):
File "./swITch.py", line 300, in
swITch()
File "./swITch.py", line 84, in init
args.port, args.set, args.quiet, args.file, args.verbose, args.zomg)
File "./swITch.py", line 173, in main
if self.is_comment(self.strip_whitespace(raw_cmd)):
File "./swITch.py", line 293, in is_comment
if str[0] == '#':
IndexError: string index out of range

]# python3 ./swITch.py -va auth.txt -i '10.1.1.246,cisco_ios' -c set-clock.cmd
Traceback (most recent call last):
File "./swITch.py", line 300, in
swITch()
File "./swITch.py", line 84, in init
args.port, args.set, args.quiet, args.file, args.verbose, args.zomg)
File "./swITch.py", line 165, in main
if self.is_comment(self.strip_whitespace(raw_cmd)):
File "./swITch.py", line 293, in is_comment
if str[0] == '#':
IndexError: string index out of range

Specify filesystem to transfer image to

Currently, the SCP file copy is transferred to flash: on Cisco devices. For a stack of devices that are to be upgraded, the ability to have the copied image onto all members of the stack would be helpful. Investigate the best way to get the image onto all devices of the stack.

Set boot flash ? :-)

Hi I tried the following cli.config

config t
boot system switch all flash:/c2960x-universalk9-mz.152-6.E.bin

It just hangs, and does not finish.

can't copy file to cisco switch

Hi there,

I love your script!
When copying iOS firmware to a switch using -f I get an error

besides that I'd like to copy it to all switches, instead of only the 'master' I hope this is possible.

#python swITch.py -e -i ip.list -a auth.txt -f c2960x-universalk9-mz.152-6.E.bin

SSH connection open to 10.xxx.xxx.xxx


Start transfer process: 2019-03-07 13:38:31.122455
Traceback (most recent call last):
  File "swITch.py", line 275, in <module>
    swITch()
  File "swITch.py", line 81, in __init__
    args.port, args.suppress, args.file, args.verbose, args.zomg)
  File "swITch.py", line 200, in main
    log.event('info', dev.transfer_file(file_image))  
  File "/Users/dennis/Downloads/swITch-master/device_connector.py", line 116, in transfer_file
    scp_transfer.transfer_file() # Transfer file                                      
  File "/Library/Python/2.7/site-packages/netmiko/scp_handler.py", line 279, in transfer_file
    self.put_file()
  File "/Library/Python/2.7/site-packages/netmiko/scp_handler.py", line 292, in put_file
    self.scp_conn.scp_transfer_file(self.source_file, destination)
  File "/Library/Python/2.7/site-packages/netmiko/scp_handler.py", line 39, in scp_transfer_file
    self.scp_client.put(source_file, dest_file)
  File "/Library/Python/2.7/site-packages/scp.py", line 157, in put
    self._recv_confirm()
  File "/Library/Python/2.7/site-packages/scp.py", line 361, in _recv_confirm
    raise SCPException(asunicode(msg[1:]))
scp.SCPException: Privilege denied.

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.