Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automating configuration backups on ERS5520 2

Status
Not open for further replies.

pjevnisek

IS-IT--Management
Sep 8, 2005
63
0
0
CA
We've got a number of 5520 switches in our environment on which I would like to automate the backups of the configuration files on a weekly basis. It doesn't appear that I can do that within the switch so how would you suggest I go about doing this? I would think I can accomplish this using scripts but I've never written a script before. Any guidance would be appreciated.

Peter
 
How many is "a number"? If you have a lot of network devices - switches, routers, etc., you may want to look at some sort of network automation tools. We use HP Network Automation software (formerly Opsware NAS) to automate backups of 110+ devices.

You could also use Expect scripting language to develop a script to telnet to your switches and TFTP the config from them.

You can download languages such as Expect and Perl from ActiveState.com Also, if you have a Linux box, most scripting languages are based on *nix systems, so it doesn't cost you more than picking up an O'Reilly book to try out a scripting language.

Note that you probably want both the Binary configuration and the ASCII config from the 5500 switches. The Binary is basically a config memory dump of the switch - its huge (2 megs for just one switch, if I remember some of my backups) and its tied to that switch - if you back up a stack of two 48 port 5520 switches, the binary config can only be restored to a stack of two 48 port 5520 switches. Now you can grab the ASCII config, which is human-readable. One issue with this is that not every config item always shows in this config - I have a Nortel CR that will show up in the next code version for a OSPF cost parameter that doesn't show up in this config yet it stays set and retained through a reboot (and probably will be saved in the binary config).
 
If you don't mind having the SNMP read/write community set you could use Net-SNMP ( and the S5-AGENT MIB to copy the configs to a TFTP server. You can restrict SNMP access by IP address.

As curtismo noted the results will be binary files, newer code may also have options for ASCII downloads via SNMP but I'm several versions behind so I can't confirm. This should get you started:

First we set the TFTP server address:
c:\>snmpset -v 1 -c private switchname .1.3.6.1.4.1.45.1.6.4.2.2.1.5.1 a 192.168.1.55

It should return something like:
SNMPv2-SMI::enterprises.45.1.6.4.2.2.1.5.1 = IpAddress: 192.168.1.55

Then the config filename:
c:\>snmpset -v 1 -c private switchname .1.3.6.1.4.1.45.1.6.4.2.2.1.4.1 s config.cfg

It should return something like:
SNMPv2-SMI::enterprises.45.1.6.4.2.2.1.4.1 = STRING: "config.cfg"

This starts the transfer of a binary config file from the switch to TFTP, there are a whole bunch of other options to transfer microcode and such - I don't see an ASCII option though.
c:\>snmpset -v 1 -c private switchname .1.3.6.1.4.1.45.1.6.4.2.1.24.0 i 4

It should return something like:
SNMPv2-SMI::enterprises.45.1.6.4.2.1.24.0 = INTEGER: 4

This will tell you the status of the transfer, 1=Nothing 2=TransferInProgress 3=sucess 4=fail
c:\>snmpget -v 1 -c private switchname .1.3.6.1.4.1.45.1.6.4.2.1.25.0

It should return something like:
SNMPv2-SMI::enterprises.45.1.6.4.2.1.25.0 = INTEGER: 3

Hope this helps,
anthony
 
Thank you both for taking the time to provide your valuable feedback. I will give Net-SNMP a try - sounds like it could work for my purposes.

Peter
 
If you're familiar with Perl you could have a look at the following;


There are some differences between some of the models and while the script isn't pretty it gets the job done dumping the binary configuration to a TFTP server. You could also probably write an Expect script but as curtismo points out, it's a question of how many switches you need to automate - will it be worth your time and effort.

Good Luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top