Saving switch configs with script

OfWolfAndManOfWolfAndMan ■■□□□□□□□□ Posts: 923Member ■■□□□□□□□□
For how many times people forget to do a #write memory in their switches, I have come up with the idea to attempt writing a script to do it once a week and forcing it onto several hundred devices. Does anyone have any insight on this? It would be highly appreciated. Thanks!
:study:Reading: Lab Books, Ansible Documentation, Python Cookbook 2018 Goals: More Ansible/Python work for Automation, IPSpace Automation Course [X], Build Jenkins Framework for Network Automation []

Comments

  • RouteMyPacketRouteMyPacket Posts: 1,104Member
    Cisco Prime, Solarwinds, and Kiwi CatTools to name a few platforms that can accomplish this. I'd be more concerned about backing up the configs but again you can push out any commands you like via these as well
    Modularity and Design Simplicity:

    Think of the 2:00 a.m. test—if you were awakened in the
    middle of the night because of a network problem and had to figure out the
    traffic flows in your network while you were half asleep, could you do it?
  • DevilWAHDevilWAH ■■■■■■■■□□ Posts: 2,997Member ■■■■■■■■□□
    expect/TCL scripting can open this up for you, I cant find the thread where we were posting example scripts a year or so back, but I think I put mine in there.

    you can open up a ssh connection run commands, parse the out puts and do as you like.

    It is very easy once you get it, you run a command, tell it what to wait for (command prompt) and then what to do next. I have it going round all our old 3com devices backing them up to FTP server and then saving the running config. It also alerts me to changes.

    Routemypacket listed some good programs that do it jsut as well (better) but for the thrill of a home made solution TCL is a great way to start :)
    • If you can't explain it simply, you don't understand it well enough. Albert Einstein
    • An arrow can only be shot by pulling it backward. So when life is dragging you back with difficulties. It means that its going to launch you into something great. So just focus and keep aiming.
  • networker050184networker050184 Mod Posts: 11,962Mod Mod
    Yeah I'd use something like Rancid to pull the configs and back them up. A simple home made perl/python/etc. script could log in write mem and pull the config too. Plenty examples on the internet to get you started.
    An expert is a man who has made all the mistakes which can be made.
  • CodeBloxCodeBlox Posts: 1,363Member
    We are using SolarWinds Orion and it backs up configs nightly.
    Currently reading: Network Warrior, Unix Network Programming by Richard Stevens
  • volumevolume ■■□□□□□□□□ Posts: 56Member ■■□□□□□□□□
    I think you could use kron to do that. Or you could have it back up your running-configs once a week.

    Back up and Restore Configuration Files - Cisco
  • OfWolfAndManOfWolfAndMan ■■□□□□□□□□ Posts: 923Member ■■□□□□□□□□
    We have Solarwinds, even though we haven't completely implemented it yet. We did before and the hard drive on the server died on us. I'll stick with that. Now we're working on getting the licenses taken care of. Thanks guys! Also, DevilWAH, is there a good online tutorial for tclsh specific to Cisco? I have found the foreach command to ping a range of ip addresses, but that's about it. I've been trying to download tcl from the tcl.tk website, but I'm not sure how to open the files on windows.
    :study:Reading: Lab Books, Ansible Documentation, Python Cookbook 2018 Goals: More Ansible/Python work for Automation, IPSpace Automation Course [X], Build Jenkins Framework for Network Automation []
  • DevilWAHDevilWAH ■■■■■■■■□□ Posts: 2,997Member ■■■■■■■■□□
    http://www.techexams.net/forums/off-topic/78829-linux-scripts-connection-ssh-sessions.html

    that has a basic script that will log on a switch and run a command, should not be to hard to change to do CISCO
    • If you can't explain it simply, you don't understand it well enough. Albert Einstein
    • An arrow can only be shot by pulling it backward. So when life is dragging you back with difficulties. It means that its going to launch you into something great. So just focus and keep aiming.
  • OfWolfAndManOfWolfAndMan ■■□□□□□□□□ Posts: 923Member ■■□□□□□□□□
    Ok one more question. In all of your experiences as network admins/engineers/analysts/architects, what would be the ideal scripting language to learn?
    :study:Reading: Lab Books, Ansible Documentation, Python Cookbook 2018 Goals: More Ansible/Python work for Automation, IPSpace Automation Course [X], Build Jenkins Framework for Network Automation []
  • networker050184networker050184 Mod Posts: 11,962Mod Mod
    Perl is what I've seen the most of by far. Python probably comes in second. Personally I've been trying to learn some Python and Ruby.
    An expert is a man who has made all the mistakes which can be made.
  • lsud00dlsud00d Posts: 1,571Member
    Kind of along the same lines...do y'all do 'reload in x' when making config changes in case a SNAFU happens?
  • PurpleITPurpleIT Posts: 327Member
    lsud00d wrote: »
    Kind of along the same lines...do y'all do 'reload in x' when making config changes in case a SNAFU happens?

    Yup, but ideally I am not making those kinds of changes during the standard work-day.

    By "those kinds of changes" I mean something so major that I lose connectivity or reloading is faster than undoing all of my work.
    WGU - BS IT: ND&M | Start Date: 12/1/12, End Date 5/7/2013
    What next, what next...
Sign In or Register to comment.