Router Configuration Backup Utility 2 (conf_bkup_show_run)

Top  Previous  Next

Router Configuration Backup Utility 2 (conf_bkup_show_run)

Unlike the copy_to_tftp script, this script backs up the router configurations by telneting to the router and performing a “show run”.  Any extra information from the telnet session is stripped off and the file is then saved to the system where the script is run from.  This script is useful when a TFTP server is not available or the router cannot reach the TFTP server (e.g. routers outside a Firewall)

 

Program Name: conf_bkup_show_run

 

Script Argument

Description

-rf <filename>

List of routers or IP Address to run script against (REQUIRED)

-dir <directory name>

If specified, tells script to save config file for each device to this directory.  If the directory does not exist, the script will create it.  The directory entered can be either an absolute directory or a relative directory.  If running the script from the GUI, a relative directory is relative to the “SCRIPT_HOME” variable.  See below for more information.  (From the GUI see Options->Settings). (OPTIONAL)

-wm

Saves configuration file to NVRAM after copying file to TFTP server.  If tftp backup failed, the write mem will not be performed.  This option performs a “write memory” on the router.  (OPTIONAL)

-nokey

Dont prompt user for encryption key when using encrypted password file.  (OPTIONAL)

-urfn

Use Route File Name.  Use ip address/name in route file for config file name instead of router hostname.

-ssh

Use Secure Shell when accessing routers.  Do NOT use with -pw option. (OPTIONAL)

-pw <filename>

Login/Password File.  (OPTIONAL)

-log <filename>

Save detailed trace file to a name other than the default file name.  (OPTIONAL)

-ulog

Unique Log file.  Save detailed trace log file to a Unique filename automatically created by script. Filename will be in format of scriptname_timestamp.log. (OPTIONAL)

 

The configuration filename that is saved is <router_name--confg.txt>.  There is also an option to have the configuration filename be the name/ip_address that is specified in the router file (i.e. rf <filename>).  This is done using the urfn option.  For example, if one of the lines in the router file is 10.10.1.1, then the config file name would be 10.10.1.1--confg.txt.  The directory that the configuration files are saved to can also be changed using the “-dir” option.  If the -dir option is omitted; by default the script will save the router configuration files to the following locations:

 

Script Run From

Location

MS Windows GUI

c:\Program Files\net-sense\userdata

Unix/Linux GUI and command line

$HOME/net-scripts

MS Windows command line

Current directory script is run from

 

If the directory does not exist, the script will create it.  If the -dir option is used with a relative path name (not absolute path name), the stated directory is relative to the directories stated in the above table

 

 

Sample Command: The following command will backup the configuration files for the routers listed in the file rtrs.rt.  The configuration files will be stored in the directory $HOME/net-scripts/02-25-03_configs.  The config files will automatically be touched on the TFTP server.  The tftproot option also causes the script to automatically create the directory specified in the subdir option.  It will also save the configuration to NVRAM using the “write memory” command. The script WILL prompt the user for passwords because the -pw option is not being used.

 

conf_bkup_show_run rf rtrs.rt dir 02-25-03_configs -wm