[c-nsp] Config sync utility

Stig Meireles Johansen stig.johansen at datametrix.no
Thu May 19 13:12:26 EDT 2011


Jason Lixfeld wrote:
>For example, if I want to synchronize the logging and ntp configs on 30 IOS devices (for simplicity, we'll say that all these devieces are the same and running the same train of code being, at most, only one, maybe two maintenance versions apart from one another) against a master logging and ntp config block.
>I've got all the configs backed up regularly via RANCID, but all RANCID does is provide a diff.  It doesn't have the intelligence to spit out an output that includes, for example, no logging host 1.1.1.1 before adding logging host 2.2.2.2.

RANCID is enough :)

A quick expect hack;

Put the following into a file (f.ex. your-script-file.tcl)
expect "#"
send "conf term\n"
expect "(config)#"
send "no logging host 1.1.1.1\n"
expect "(config)#"
send "logging host 2.2.2.2\n"
expect "(config)#"
send "ntp server 2.2.2.2\n"
expect "(config)#"
send "end\n"
expect "#"
send "copy running-config startup-config\n"
expect "#"

And run it on your hosts like;

clogin -s your-script-file.tcl 10.0.0.1 10.0.0.2 10.0.0.3 10.0.0.4 etc. etc.

You can put all the "intelligence" you want into the script, checking for something and acting upon it or not.

/Stig



More information about the cisco-nsp mailing list