|
Backing up network devices for free... |
|
Backing up network devices for free... In reference to my previous blog entry Backups, not just for computers anymore..., I thought I would provide a glimpse "under the hood" and explain the specific programs that I used to create a system that automatically back up the configurations of my routers and switches.
The 50k-foot theory of operation is this: For each network device on the network (router or switch), automatically log into each device as a user, copy the running configuration to a TFTP server, and log out.
There are several key components to this system:
1- A TFTP server (TFTPServerMultiThreadedInstallerV1.32.exe). Since I back up different types of equipment, I use a command-line TFTP server which allows me to copy the configs of each type of equipment to different folders on my server. (This software also allows you to run it as a service.) Functionally-speaking, any TFTP software should work, but I wanted the ability to segregate the files on an equipment-type basis.
2- A batch file (BackupRouterConfig.cmd) which: a. Pings the network to find the active devices on the network (using namp.exe from http://nmap.org/download.html; be sure to read the instructions about installing WinPcap under the “Windows (NT/ME/2K/XP/Vista) binaries” section). b. Creates a text file containing the active devices on the network. c. Parses the list of IP addresses and lights up the terminal emulation program macro (BackupRouterConfig.ttl).
3- A terminal emulation program called Tera Term Pro (ttpro313.zip). I chose this software for several reasons: a. It’s lightweight. b. It’s fairly stable. c. It’s free. d. It’s customizable. e. It contains a nice macro language which lets a user automate tasks. The name of the macro file used for the router backups is “BackupRouterConfig.ttl”. There is a text file (ttpmacro.txt) that explains how to implement the macro language and lists the available macro commandsv4- A scheduling program called System Scheduler which is configured to fire off the backup routine on a periodic basis (http://www.splinterware.com/products/wincron.htm).
5- An SMTP program called sendEMail to E-mail me a notification saying the backup routine had completed (http://caspian.dotconf.net/menu/Software/SendEmail/#download).
The order of operation is as follows:
1- The scheduler fires off the batch file BackupRouterConfig.cmd.
2- BackupRouterConfig.cmd will use nmap.exe to generate a list of active routers (ActiveRouters.txt).
3- BackupRouterConfig.cmd will parse ActiveRouters.txt and fire off the Tera Term Pro macro (BackupRouterConfig.ttl) for each device.
4- After all devices have been backed up, an E-mail will be sent to me saying the procedure is complete.
The macro has the address of the tftp server, username, and password hard-coded into it. The filename generated for the config is a combination of the system name, IP address, and the date when the routine was run.
If you have any questions about how to set up the system, or if anything isn’t clear, please let me know. This system overall has worked well (especially after I implemented the “see if the device is alive” checks). |
|