ctomkow / switch Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
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)
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
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.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.