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
<a href="http://10.2.1.1">10.2.1.1</a> and <a href="http://10.2.1.50">10.2.1.50</a> and run the commands in cmds.txt<br><br>for (( i = 1 ; i <= 50; i++ ))<br>do<br> /home/rancid/bin/clogin -x /home/rancid/cmds.txt
10.2.1.$i<br>done<br><br>then you can edit cmds.txt to contain whatever commands you would like to send, currently my cmds.txt contains:<br><br>show cdp ent *<br>exit<br><br><br>Good luck!<br><br>Chris Stave<br>Drew University
<br><br><div><span class="gmail_quote">On 6/1/06, <b class="gmail_sendername">Shekhar Basnet</b> <<a href="mailto:shekhar@mos.com.np">shekhar@mos.com.np</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div>
Hello all,<br>
<br>
Suppose I want to run a command say "show diag" in all the routers of different router.db files, what command do I issue?<br>
<br>
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?<br>
<br>
TIA<br>
S.<br>
<table cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td>
<pre></pre>
<br></td>
</tr>
</tbody></table>
</div>
</div><br>_______________________________________________<br>Rancid-discuss mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Rancid-discuss@shrubbery.net">Rancid-discuss@shrubbery.net
</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss" target="_blank">http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss</a><br><br>
</blockquote></div><br>