Page 1 of 2

Backup/Restore from RANCID

Posted: Thu Dec 17, 2015 3:47 pm
by SyncKev
WS-12-250-AC
Firmware Ver 1.3.8

For purposes of replacing a failed device, we store backup configs using RANCID and load the backup configs on replacement devices.
We use this on Adtran, Juniper, and other manufacturer's routers/switches.

Experimenting with backup/restore from the Netonix WS-12-250-AC, I have been unable to restore any backups that contain information from 'show config'. I do not get an error; the switch just reboots to the unedited config.
When I compare this to the file saved from the 'Backup' option, I see that there are some differences, including security certificate information. Any changes to the saved restore file (i.e. system name or IP address) results in a corrupted system which I then default to get running again.

Does anyone successfully use RANCID to backup configs for Netonix switches that work for restoration of the config to a replacement switch?

Thanks

Re: Backup/Restore from RANCID

Posted: Thu Dec 17, 2015 4:38 pm
by sirhc
You do realize there is an "auto" backup to tftp server that will create a backup file anytime there is a change made to the switch.

This feature is located on the Device/Configuration Tab

Re: Backup/Restore from RANCID

Posted: Thu Dec 17, 2015 4:59 pm
by SyncKev
Yes. I would prefer to use RANCID to keep all configs in the same location, and allowing easy diff capability; however, I will use the auto backup if that is the only option.
Thank you

Re: Backup/Restore from RANCID

Posted: Thu Dec 17, 2015 5:04 pm
by sirhc
SyncKev wrote:Yes. I would prefer to use RANCID to keep all configs in the same location, and allowing easy diff capability; however, I will use the auto backup if that is the only option.
Thank you


I will ask the programmer Eric to review this thread.

Re: Backup/Restore from RANCID

Posted: Fri Dec 18, 2015 2:22 pm
by jbaird
SyncKev wrote:Yes. I would prefer to use RANCID to keep all configs in the same location, and allowing easy diff capability; however, I will use the auto backup if that is the only option.
Thank you


+1 for RANCID support. RANCID is widely used across all platforms on our network, and it would be nice if we could use it to backup our Netonix configs as well.

Re: Backup/Restore from RANCID

Posted: Fri Dec 18, 2015 2:24 pm
by sirhc
I created an instance in our internal software for Eric (the programmer) to look into for you.

Re: Backup/Restore from RANCID

Posted: Fri Dec 18, 2015 3:38 pm
by Eric Stern
Don't know much about RANCID other than the little bit I just read about it. As I understand it you need to write a RANCID script to handle the device. So here is some information that might help.

The GUI backup/restore method uses a binary file (its a tar archive) that contains the configuration file and a few other things. This is the best way to do it. You can also do it from the CLI. The CLI has the "copy" command get the backup file to/from the device, but then you need to run a TFTP server which might not be convenient. You can also do it from the command line.

- use the "cmdline" CLI command to get to the linux command line
- use the "config_backup" command to create the backup file (/tmp/wispswitch_config.tar)
- use scp to get the backup file from the switch
- un-tar the file to get at the config.json file
- use the config.json file to do the diff so RANCID can report the changes

To restore you can reverse the process
- copy the backup file to switch using scp (lets say you copy it to /tmp/restore_config.tar)
- use the "cmdline" CLI command to get to the linux command line
- change to the /www directory
- run "php-cli config.php --restore /tmp/restore_config.tar"
- run "reboot"

Re: Backup/Restore from RANCID

Posted: Fri Dec 25, 2015 2:10 pm
by mnitech
Can you share your scripts and settings to get rancid to run on a Netonix?

Re: Backup/Restore from RANCID

Posted: Wed Dec 30, 2015 9:47 am
by SyncKev
Eric Stern wrote:Don't know much about RANCID other than the little bit I just read about it. As I understand it you need to write a RANCID script to handle the device. So here is some information that might help.

The GUI backup/restore method uses a binary file (its a tar archive) that contains the configuration file and a few other things. This is the best way to do it. You can also do it from the CLI. The CLI has the "copy" command get the backup file to/from the device, but then you need to run a TFTP server which might not be convenient. You can also do it from the command line.

- use the "cmdline" CLI command to get to the linux command line
- use the "config_backup" command to create the backup file (/tmp/wispswitch_config.tar)
- use scp to get the backup file from the switch
- un-tar the file to get at the config.json file
- use the config.json file to do the diff so RANCID can report the changes

To restore you can reverse the process
- copy the backup file to switch using scp (lets say you copy it to /tmp/restore_config.tar)
- use the "cmdline" CLI command to get to the linux command line
- change to the /www directory
- run "php-cli config.php --restore /tmp/restore_config.tar"
- run "reboot"


Eric,
Thank you for the reply. RANCID works by parsing the output from command line entries executed. For example, part of the script for Adtran devices issues the command "show running-config". I have adjusted a script for Netonix, which captures the output for 'show config'; however, it does not contain enough information for a restore. Is there a command line function that will out put the full config needed for a restore? Thank you.

Re: Backup/Restore from RANCID

Posted: Wed Dec 30, 2015 9:49 am
by SyncKev
mnitech wrote:Can you share your scripts and settings to get rancid to run on a Netonix?


I would be happy to, but currently it does not backup the full config, just the output from 'show config'.
If a working script develops, I will share it.