Fibre Channel (SAN)

Utility to backup the configuration of SAN Switches

by afoignant on ‎11-25-2008 07:35 AM (918 Views)

I have made a script for making easily backup of the configuration of switch. I have enclosed the python script.

You can download a windows executable version at :

save-simply-your-san

It works also for Brocade and McData switches. 

The site of the project is :

http://code.google.com/p/save-simply-your-san/

With this script, you can get a backup of the configuration on your PC without installing any FTP or SSH server 

Comments
by Gautam
on ‎11-28-2008 11:49 PM

i am getting the following error..

Serving FTP on 10.20.42.59:21

FTPServer : waiting for the file

FTPServer : waiting for the file

FTPServer : waiting for the file

FTPServer : waiting for the file

FTPServer : waiting for the file

FTPServer : waiting for the file

FTPServer : waiting for the file

**TelnetClient** Transfert Failed !

kindly guide

by billyork
on ‎02-19-2009 01:45 PM

I have a similar, although less sophisticated python script. I call this script from a master shell script which passes the IP address of the switch and its name. I then cron the master script.

To run this, you will need an operator account on the brocade switch and a user account on the host that the config will be sent to.

I recommend that you run this job as root, since storing the passwords in the script can be dangerous. running as root will provide additional security for the file.

#! /usr/bin/env python

# This script uploads the config from the supplied IP to the
#  brocade user's home directory on punch
# Author: Bill York

# PARAMETERS
#  IPADDR: The IP address of the switch
#  SWNAME: The name of the switch

import telnetlib
import sys

# initialize variables
user = "brocade"
# storing passwords in the file is INHERENTLY INSECURE. do it anyway.
spwd = "BrocadeUserPasswordOnSwitch"
upwd = "BrocadeUserPasswordOnHost"
# The master script MUST PASS the IP address of the switch to backup. THERE IS NO ERROR CHECKING HERE.
IPADDR = sys.argv
SWNAME = sys.argv

# open connection to switch
tn = telnetlib.Telnet(IPADDR)

# enter user name
tn.read_until("login: ")
tn.write(user + "\n")

# enter password
tn.read_until("Password: ")
tn.write(spwd + "\n")

# send configupload command
uploadcommand = "configupload -p scp IPADDRESSOFHOST,brocade,\"/home/brocade/" + SWNAME + "\"\n"
# Don't forget to allow IPTABLES ssh access from the switch.
tn.write(uploadcommand)

# stupid command does not allow for password entry while using scp
# so wait for it to ask and then enter it.
tn.read_until("password: ")
tn.write(upwd + "\n")

# wait for the command to complete
#tn.read_until("are uploaded")

# get out
tn.write("exit\n")

# we're done.

by lemons_terry
on ‎05-13-2010 01:07 PM

Hi

I just downloaded save-simply-your-san, and it works great!  I looked at the backup file it creates, and it looks complete.

But how do I do a restore to a Brocade switch?  Do I use the standard 'cfgdownload' command?

Thanks!

tl