[rancid] Re: Run a command in all the routers

Chris Stave cstave at gmail.com
Thu Jun 1 14:00:46 UTC 2006


I've had good luck with scripts calling clogin, my devices are sequentially
addressed, so a simple loop takes care of them all for me.  It doesn't
matter so much that they're in router.db as that they are in .cloginrc.  As
far as using router.db files to determine which devices get the command
issued, it's a little tougher.  If it is something that you're going to use
a lot, you could write a script for each grouping.  Below is my script to
connect to everything between 10.2.1.1 and 10.2.1.50 and run the commands in
cmds.txt

for ((  i = 1 ;  i <= 50;  i++  ))
do
 /home/rancid/bin/clogin -x /home/rancid/cmds.txt 10.2.1.$i
done

then you can edit cmds.txt to contain whatever commands you would like to
send, currently my cmds.txt contains:

show cdp ent *
exit


Good luck!

Chris Stave
Drew University

On 6/1/06, Shekhar Basnet <shekhar at mos.com.np> wrote:
>
>  Hello all,
>
> Suppose I want to run a command say "show diag" in all the routers of
> different router.db files, what command do I issue?
>
> Thats one. I have 18 router.db files polling 72 devices. Now I want to
> issue that command in only 9 router.db files. How do I tackle that?
>
> TIA
> S.
>
>
>
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20060601/96cc24a6/attachment.html 


More information about the Rancid-discuss mailing list