<div>Hi Chris;</div>
<div>&nbsp;</div>
<div>I never used -x flag but I always test it with following command to ensure device/config is functioning properly;</div>
<div>/var/lib/rancid/bin/clogin&nbsp; -c &#39;show clock&#39; test-c3560-acc-sw1</div>
<div>&nbsp;</div>
<div><strong>Configuration example on Ubunto 8.x;</strong><br></div>
<div>adduser rancid –rancid /var/lib/rancid<br>su rancid<br>/var/lib/rancid/bin/rancid-cvs<br>cd /var/lib/rancid<br>rancid-run</div>
<div>chmod 777 /var/lib/rancid/.cloginrc<br>chown -R rancid /etc/cvsweb<br>=====================================================<br>/etc/postfix/<a href="http://main.cf">main.cf</a> <br>removed;<br><a href="mailto:myemail@email.com">myemail@email.com</a>, , localhost.localdomain, localhost<br>
/etc/init.d/postfix restart<br>=====================================================</div>
<div><strong>1. Add to Hosts file;</strong><br>nano /etc/hosts<br>example; 172.16.30.1 test-c3560-acc-sw1</div>
<div>&nbsp;</div>
<div><strong>2. Add device password to .cloginrc</strong></div>
<div>nano /root/.cloginrc<br>example follows;<br>add user test-c3560-acc-sw1 testacc<br>add userpassword test-c3560-acc-sw1 password<br>add password test-c3560-acc-sw1 password enablepassword<br>add method test-c3560-acc-sw1 {ssh}</div>

<div>&nbsp;</div>
<div><strong>3. Edit to&nbsp; Router.db</strong><br>nano /var/lib/rancid/switches/router.db<br>nano /var/lib/rancid/CVS/switches/router.db<br>example; test-c3560-acc-sw1:cisco:up</div>
<div>&nbsp;</div>
<div>-- Run it;<br>./bin/rancid-run -r test-c3560-acc-sw1<br><strong>Test:</strong><br>/var/lib/rancid/bin/clogin&nbsp; -c &#39;show clock&#39; test-c3560-acc-sw1<br>./clogin test-c3560-acc-sw1<br>/usr/lib/rancid/bin/clogin&nbsp; -c &#39;write term&#39; test-c3560-acc-sw1 &gt; /var/lib/rancid/backups/test.cfg</div>

<div>-- Configure CVSWeb -<br>/etc/cvsweb/cvsweb.conf<br>Basedir=/usr/local/rancid; expert basedir<br>path=/usr/local/rancid/bin:/usr/local/bin:/usr/lib/usr/bin:/usr/bin<br>CVSROOT=$basedir/CVS</div>
<div>CVSWEBs;<br>/etc/cvsweb<br>/usr/share/cvsweb<br>/usr/lib/cgi-bin/cvsweb<br>/usr/share/doc/cvsweb</div>
<div>=====================================<br># run config differ hourly<br>1 * * * * /usr/lib/rancid/rancid-run<br># clean out config differ logs<br>50 23 * * * /usr/bin/find /var/lib/rancid/logs -type f -mtime +2 -exec rm {} \;<br>
-----------------------------------------------------------------------------------------------------<br></div>
<div>I hope this helps</div>
<div>&nbsp;</div>
<div>Dean</div>
<div>&nbsp;</div>
<div><br><br>&nbsp;</div>
<div class="gmail_quote">On Mon, Dec 29, 2008 at 4:03 PM, Chris Knight <span dir="ltr">&lt;<a href="mailto:boheme@gmail.com">boheme@gmail.com</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Howdy,<br><br>&nbsp;I am new to rancid, and I apologize if this is considered a newbie<br>question. &nbsp;I am trying to use rancid to send a set of canned commands<br>
to a Cisco ASA. &nbsp;I have installed rancid 2.3.2a7 onto a RHEL5.2 box<br>running a 2.6.18-92.1.22.el5 kernel. &nbsp;I have configured .cloginrc and<br>tested that I can log into the ASA using clogin.<br><br>&nbsp;After verifying that I could log into the ASA via clogin, I<br>
constructed a very simple command file, that contains only two<br>commands &quot;show ver&quot; and &quot;show run&quot;. &nbsp;I invoke this command file with<br>this command line:<br><br>&nbsp;./bin/clogin asa-office -x test.cmd<br>
<br>&nbsp;What appears to happen is that clogin does in fact log into the ASA,<br>and then it stalls. &nbsp;If I let it sit for five minutes, nothing<br>happens. &nbsp;So, I type &#39;exit&#39;. &nbsp;Now clogin appears to be invoking<br>telnet, and if I let that sit for a few minutes it times out:<br>
<br>[rancid@zack ~]$ ./bin/clogin asa-office -x test.cmd<br>asa-office<br>spawn ssh -c 3des -x -l proxyit asa-office<br>proxyit@asa-office&#39;s password:<br>Type help or &#39;?&#39; for a list of available commands.<br>hq&gt; enable<br>
Password: *************<br>hq#<br>hq# exit<br><br>Logoff<br><br>Connection to asa-office closed by remote host.<br>Connection to asa-office closed.<br>-x<br>spawn telnet -x<br>telnet&gt; enable<br>?Invalid command<br>telnet&gt;<br>
Error: TIMEOUT reached<br>can not find channel named &quot;exp6&quot;<br>&nbsp; &nbsp;while executing<br>&quot;send &quot;\r&quot;&quot;<br>&nbsp; &nbsp;(&quot;foreach&quot; body line 129)<br>&nbsp; &nbsp;invoked from within<br>&quot;foreach router [lrange $argv $i end] {<br>
&nbsp; &nbsp;set router [string tolower $router]<br>&nbsp; &nbsp;# attempt at platform switching.<br>&nbsp; &nbsp;set platform &quot;&quot;<br>&nbsp; &nbsp;send_user ...&quot;<br>&nbsp; &nbsp;(file &quot;./bin/clogin&quot; line 712)<br>[rancid@zack ~]$<br><br><br>&nbsp;Is there a trick to being able to use the -x flag to invoke a list<br>
of commands when using ssh instead of telnet?<br><br>-Chris<br>_______________________________________________<br>Rancid-discuss mailing list<br><a href="mailto:Rancid-discuss@shrubbery.net">Rancid-discuss@shrubbery.net</a><br>
<a target="_blank" href="http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss">http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss</a><br></blockquote></div><br>