[166483] in North American Network Operators' Group

home help back first fref pref prev next nref lref last post

Re: Network configuration archiving

daemon@ATHENA.MIT.EDU (R. Scott Evans)
Fri Oct 25 14:17:59 2013

Date: Fri, 25 Oct 2013 14:17:24 -0400
From: "R. Scott Evans" <nanog@rsle.net>
To: nanog@nanog.org
In-Reply-To: <20131025115948.GF10952@rootmail.cc.le.ac.uk>
Errors-To: nanog-bounces+nanog.discuss=bloom-picayune.mit.edu@nanog.org

On 10/25/13 07:59, Matthew Newton wrote:
> For the last ~8 years we've used a very simple in-house bash
> script that uses SNMP to tell the switch to write its config using
> tftp, and then does a wr mem. It then checks the configs into a
> subversion repository and e-mails out any diffs.
>
> One criteria we had was that our config backup system wasn't going
> to get CLI access to any routers if at all possible, and this
> turned out to be a good alternative. I can't think of many times
> when it's failed to work; occasionally the odd switch might not
> respond, but that's rare.
>
> The only possible issue being that we're 100% Cisco, so I don't
> know if other vendors support the same MIBs.
>
> I'll try and post the script (250 lines) somewhere if anyone's
> interested.
>
> Cheers,
>
> Matthew

I have a very similar home-grown script, however I did need a mix of 
tftp and telnet/CLI depending on the particular platform (for instance 
recently I couldn't get the tftp approach to work with remote devices 
running IOS-XR or IOS-XE).

An overly simplified telnet module might look like:
-----------------------
#!/bin/sh
login=""
passwd=""
router=""
timeout=1		# increase this for larger configs

(sleep 1;
         echo $login;            sleep 1;
         echo $passwd;           sleep 1;
         echo term leng 0;       sleep 1;
         echo "sh run";          sleep $timeout;
         echo exit;              sleep 1;
) | telnet $router 2>&1
-----------------------

-Scott



home help back first fref pref prev next nref lref last post