03-07-2008 10:30 AM - edited 03-05-2019 09:37 PM
Hello All,
We are planning to automatic backup of startup-config or running-config for all routers and switches' using TFTP or FTP.
Can anybody provide me EEM configuration or any script so I can take automatic backup at regular interval?
Thanks,
03-07-2008 07:10 PM
Cisco has providing one tools for Managing the router configuration .
Tool name : Cisco works
http://cisco.com/en/US/products/sw/cscowork/ps2408/prod_brochure09186a00801c0a43.html
03-07-2008 07:21 PM
How about this: RANCID and it is FREE. You
can get the whole thing up and running
in 10 minutes on a gentoo linux box.
CCIE Security
03-08-2008 10:29 AM
In addition to EEM, IOS also has a built-in config archive feature. You can archive configuration diffs to flash, or to an external server. Config archive provides the ability to look at differences between configuration changes, as well as rollback changes (even timed rollback). See http://www.cisco.com/en/US/docs/ios/12_2/configfun/configuration/guide/fcf007.html for more on the built-in IOS configuration management features.
As for an EEM policy to do automatic config archives, I did this for a Networkers session I gave a few years back. It uses the EEM timer event detector to copy the config to an FTP server at a specified interval (much like the way config archive works in IOS). It requires a few environment variables to be set first:
cc_cron_entry : Cron entry for when to run the policy (works just like UNIX cron)
cc_ftp_server : FTP server to which configs will be copied
cc_ftp_path : Path on aformentioned FTP server
cc_ftp_user : (optional) FTP username (defaults to anonymous)
cc_ftp_pass : (optional) FTP password (defaults to pass)
See http://www.cisco.com/en/US/docs/ios/12_4t/netmgmt/configuration/guide/t_eemo.html for more on configuring and using EEM.
05-13-2008 07:06 PM
Just wondering if can replace environment variables with predefined FTP configuration. For example:
router(config)#ip host FTPServer a.b.c.d
router(config)#ip ftp username USERNAME
router(config)#ip ftp password PASSWORD
in this case ftp client password will be encrypted
so the command line in the script would look like "copy runn ftp://FTPServer/router1/${dest_fname}"
would it work?
05-13-2008 08:59 PM
Yes, this should work since the copy command goes through the same parser code as when it is run manually from the command line.
09-13-2017 07:30 AM
Hey Joe,
I went over the attached script, can you make the script run like once in every 24 hours without shelling to the device and exec it manually?
03-09-2008 11:42 AM
Ivan Pepelnjak has a terrific series of articles on config management:
Keep Track of Router Configurations with Configuration Archive
http://www.nil.com/ipcorner/RouterConfigArch/
Router Configuration Management ⦠Too Good to be True?
http://www.nil.com/ipcorner/RouterConfigMgmt/
If you're looking for an affordable config management solution, Adventnet's DeviceExpert product has been working well for us.
05-28-2008 09:40 AM
I have tried Ivan's EEM script, but unable to action the cli command "archive config".
event manager applet ArchiveModifiedConfig
event counter name "ConfigCounter" entry-val 1 entry-op eq exit-val 1 exit-op gt
action 1.0 cli command "archive config"
action 2.0 syslog msg "Modified configuration archived"
action 1.0 does not invoke, but i do see a syslog message which is 2.0
just wondering if you have tried it.
05-28-2008 09:42 AM
The first command needs to be enable:
event manager applet ArchiveModifiedConfig
event counter name "ConfigCounter" entry-val 1 entry-op eq exit-val 1 exit-op gt
action 1.0 cli command "enable"
action 2.0 cli command "archive config"
action 3.0 syslog msg "Modified configuration archived"
05-28-2008 10:30 AM
thanks. it worked.
can we do or capture some diffs in an automated way, i know we can do that manually.
05-28-2008 11:27 AM
You can use the show archive config differences command to diff any two files right on the device. You can then pipe this output to a file.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide