Discussion:
[rancid] provisioning a config with rancid
A J
2010-06-23 01:57:31 UTC
Permalink
i noticed the [-x command-file] usage and was wondering if this is
perhaps the way to provision commands to the switches...like if I
wanted to change the password on a few different switches at once.



-bash-3.2$ /usr/local/rancid/bin/clogin

Error: Usage: /usr/local/rancid/bin/clogin [-dSV] [-autoenable] [-
noenable] [-c command] [-Evar=x] [-e enable-password] [-f cloginrc-
file] [-p user-password] [-s script-file] [-t timeout] [-u username]
[-v vty-password] [-w enable-username] [-x command-file] [-y
ssh_cypher_type] router [router...]
-bash-3.2$
Arne Svennevik
2010-07-12 13:25:51 UTC
Permalink
----- Original Message -----
i noticed the [-x command-file] usage and was wondering if this is
perhaps the way to provision commands to the switches...like if I
wanted to change the password on a few different switches at once.
You're right, you can use the -x switch to push config to several switches at once. We use it regularly to make sure a set of devices are configured the same way, like this:
bin/clogin -x <file> switch1 switch2 switch3 switch4

Just place the set of commands to execute in the text file and run clogin. It will log in to each device, run the set of commands and log off again. The list of commands can for example be:
conf t
enable secret <something>
exit
wr mem


If you only need to execute one command on each device, instead use the -c switch like this:
bin/clogin -c "show version" switch1 switch2 switch3 switch4


Regards,
Arne Svennevik
Jose Madrid
2010-07-12 19:19:27 UTC
Permalink
I have also run multiple commands with the -c switch. Something like

bin/clogin -c "conf t; logging 10.0.0.1; exit; wri mem" router1
Post by Arne Svennevik
----- Original Message -----
i noticed the [-x command-file] usage and was wondering if this is
perhaps the way to provision commands to the switches...like if I
wanted to change the password on a few different switches at once.
 bin/clogin -x <file>  switch1 switch2 switch3 switch4
 conf t
 enable secret <something>
 exit
 wr mem
 bin/clogin -c "show version"  switch1 switch2 switch3 switch4
Regards,
Arne Svennevik
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
--
It has to start somewhere, it has to start sometime.  What better
place than here? What better time than now?
Loading...