cancel
Showing results for 
Search instead for 
Did you mean: 

i am looking for script through i can take weekly backup of configuration.

pradeep_sonawne
New Contributor II
Hi All,
I hope that you are doing well...
i am new in Brocade ICX family switches.
i have one small query if any one can help me, it will be highly appreciated !!!!
we have Brocade ICX 7450,7250 and 6430 switches and i am looking for script through i can take weekly backup of configration.
i have spend so much time to make it possible by using their in buit option which is Batch buffer but unfortunatly it not work as i accepted.

so dear all , i am looking hopefully your response.

Thanks in Advance
12 REPLIES 12

Hi Pradeep,

I need to take backup configuration for cisco and back up switches. If u already found that scripts for this task , can u share me ?

scott_farrand_f
New Contributor III

Take a look at Rancid -  http://www.shrubbery.net/rancid/

netwizz
Contributor III
Solar Winds NCM does a great job of it in Orion.


scott_farrand_f
New Contributor III
Apparently the link I shared for Rancid was deemed spam. 

Rancid is a free tool that has an ICX/Brocade module that will automatically poll the configuration of a given switch, it leverages code versioning software to maintain an archive of all switch/router configuration changes, and can be configured to automatically e-mail a network team to alert them about configuration changes made to networking environment.

If you're going to delete comments like mine as "spam" perhaps you should also delete references to other software solutions.

fernando_fl_rez
New Contributor III
If you need a python script I can help.

If you have python installed check that you have setup_tools installed too.

If you don't then:

1) Download: https://bootstrap.pypa.io/get-pip.py
2) python get-pip.py

Install netmiko:

# pip install netmiko

Then the script:

from netmiko import ConnectHandler

from datetime import datetime
import argparse
from getpass import getpass


def main(conf):
    conn = ConnectHandler(**conf)
    dump = conn.send_command('show run')
    filename = 'backup_%(ip)s_%(timestamp)s.conf' % {
        'ip': conf.get('ip'),
        'timestamp': datetime.now().strftime('%s')
    }
    with open(filename, 'wb+') as dump_file:
        dump_file.write(dump)


if __name__ == '__main__':
    command_line = argparse.ArgumentParser()
    command_line.add_argument('--ip', help='IP address of your ruckus ICX')
    command_line.add_argument('--username', help='SSH username')
    command_line.add_argument('--password',
                              help='SSH password (clear text btw!)')

    try:
        args = command_line.parse_args()
    except TypeError:
        print u'Unable to parse args'
    else:
        if None in (args.ip, args.username):
            print u'IP and username is required'
        else:
            _password = args.password
            if not _password:
                _password = getpass()
        conf = {
            'device_type': 'ruckus_fastiron',
            'ip': args.ip,
            'username': args.username,
            'password': _password
        }
        main(conf)


Save it as "backup_icx.py".

To execute help:

$ python backup_icx.py --help

--ip -> ip address of the icx to backup
--username -> ssh username
--password -> ssh password

To create a backup

$ python backup_icx.py --ip= --username= --password=

Becareful that password is in clear text. If you don't specify a password arg then you will be prompted for one:

$ python backup_icx.py --ip= --username=


You will need SSH enable on the hardware for this to work.

Backups will be saved on the same directory under the name "backup__.conf"

Sorry for the quickly put together script but this could guide you a little.

Cheers!