Switches, Hubs, and Modems
Showing results for 
Search instead for 
Did you mean: 

Need to automate switch config backup

Occasional Advisor

Need to automate switch config backup

Hello Guys,


Planning to automate switch configuration backup system. We are having different model of HP switche's including 1900, 1800, 5900, 2600 & 3Com Series.


I would prefer to do that from a Linux machine. Please do suggest some documents for that.

Fredrik Eriksson
Occasional Visitor

Re: Need to automate switch config backup

Hello, we are using Rancid for this.


The documentation and software is found here:



Occasional Advisor

Re: Need to automate switch config backup

Hello Fredrik,

Thanks for the info!


Actually i have tried rancid already. I installed 2.3.x version & they have bug on it.

Later on they suggest to install 3.x.x version. On top of that, i have different version of HP switches like 1900,1800,5400, 3Com switches & I guess rancid have dependencies on certain version of HP switches.


I would request others to suggest some more procedures!


Re: Need to automate switch config backup

Hello ,


Use the below VB Script it will help you .You can edit this script as per your requirement .This is an example it  will open a command prompt, telnet into an HP Procurve switch and copy its runnung config to a TFTP server.


--------Start Of Script--------
Option Explicit
On Error Resume Next
Dim WshShell, strIP, strTFTP, strFile, strPassHP
Dim filesys, filetxt

strFile = "File Name"
strTFTP = "Your TFTP Server Address"
strPassHP = "Your HP Procurve Password"

'Opens IP address file for reading
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.OpenTextFile(strFile, ForReading, True)

'Opens the command prompt
set WshShell = CreateObject("WScript.Shell")
WshShell.run "cmd.exe"
WScript.Sleep 1000

Do While Not filetxt.AtEndOfStream

strIP = filetxt.ReadLine

set WshShell = Nothing
set filesys = Nothing

Function Copy(strIP)

WshShell.SendKeys "telnet "& strIP
WshShell.SendKeys ("{Enter}")
WScript.Sleep 1000 
WshShell.SendKeys "p"
WshShell.SendKeys strPassHP
WshShell.SendKeys ("{Enter}") 
WshShell.SendKeys "copy running-config tftp " & strTFTP & " " & strIP & ".txt" 
WshShell.SendKeys ("{Enter}")
WshShell.SendKeys "^z"
WshShell.SendKeys "^z"
WshShell.SendKeys "y"
WScript.Sleep 2000
WshShell.SendKeys ("{Enter}")

End Function


Note :In order for this script to work, you will need a text file will the IP addresses of your switches on a seperate line. You will also need to edit the lines that I have maked in Bold


Thanks and regards

Anurag Thottathil