Options

LAB automation

kasujkasuj Member Posts: 19 ■□□□□□□□□□
Hi,

I'm looking for an script to automatically download/upload configuration files to a network devices mainly cisco or juniper. I'm trying to make my lab more automatic. Do you use/have anything like that?

Thank you,

Comments

  • Options
    networker050184networker050184 Mod Posts: 11,962 Mod
    So are you wanting a script that logs into the device, pulls a new config down to start up and reloads the box? If so you can find plenty of perl and python scripts out there that will run commands on a Cisco router. Just set it up with the parameters you want and let it fly.
    An expert is a man who has made all the mistakes which can be made.
  • Options
    kasujkasuj Member Posts: 19 ■□□□□□□□□□
    Yes thats exactly what I need. Can you give me any examples?

    I was thinking about creating something with expect but maybe there is something that works and I don't have to reinvent the wheel.
  • Options
    networker050184networker050184 Mod Posts: 11,962 Mod
    Here is one in perl written by a guy I used to work with.

    Great Perl Script

    Pretty straight forward. It takes a flat text file with routers and file with commands and executes them. You could probably fix it up to take a variable of the router hostname to match a config file so each router can pull a different config.

    A google search will pull up many more on the internet in all sorts of languages. I've always just grabbed something and modified it to meet my needs rather than writing something from scratch since I'm not all that great at scripting.
    An expert is a man who has made all the mistakes which can be made.
  • Options
    fiftyofiftyo Member Posts: 71 ■■□□□□□□□□
    Some old python script I wrote. https://github.com/lovwal/sysadmin/blob/master/sshscripts/template
    Edit the command variables and add some sleep while fetching the new images. Use with caution though seeing its multithreaded and not 100% reliable all the time depending on what you are doing.
Sign In or Register to comment.