Chris,<div><br></div><div>Not sure what aliases you are on, but a cron&#39;d environment may not have the aliases that you think you get.</div><div><br></div><div>Check you environment...print @ENV.</div><div><br></div><div>
Cheers,</div><div><br></div><div>Bob<br><br><div class="gmail_quote">On 14 November 2011 04:16, Chris Wopat <span dir="ltr">&lt;<a href="mailto:me@falz.net">me@falz.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I&#39;m attempting to add a device to RANCID that acts a as a Cisco<br>
device, but isn&#39;t. It&#39;s a unix server that responds to the cisco<br>
&#39;show&#39;, &#39;dir&#39; commands and has a prompt that is cisco enough to have<br>
RANCID log in. Yes I realize that new device types can be written and<br>
that a wrapper sample script exists from 2005 or so. It&#39;s my personal<br>
preference to get things working this way. Info:<br>
<br>
All of the debugging that I have indicate that it should be working,<br>
but it simply isn&#39;t. Here&#39;s the gist of what I&#39;m doing<br>
<br>
* RANCID logs in as unprivileged user. &#39;enable&#39; is aliased to &#39;su -&#39;<br>
* The user prompts are basic HOSTNAME&gt;, HOSTNAME#<br>
* The root user has aliases for &#39;show&#39;, &#39;dir&#39;, etc to spit out info<br>
that I want (cat a few config files, ls /etc/)<br>
<br>
The testing I&#39;ve done:<br>
<br>
I can properly log in to the device and become root (enable) using<br>
clogin. I can then issue commands, etc. I&#39;m simply logged in as root.<br>
<br>
    su -l rancid -c &#39;clogin HOSTNAME&#39;<br>
<br>
<br>
If I login using &#39;rancid -d HOSTNAME&#39; it shows debugginfg info. The<br>
history file of the root user on the server shows that it has issued<br>
the appropriate commands. Additionally I can use the debugging info<br>
found elsewhere in the thread to get a .new and .raw file. The<br>
commands to get these debug files:<br>
<br>
    su -l rancid -c &#39;env NOPIPE=y<br>
PATH=${PATH}:/usr/local/libexec/rancid rancid -d HOSTNAME&#39;<br>
<br>
<br>
I can view the .new and .raw files in the rancid home users&#39;s dir.<br>
Everything looks good.<br>
<br>
The only thing that does NOT work is:<br>
<br>
   su -l rancid -c &#39;rancid-run -r  HOSTNAME&#39;<br>
<br>
The logs it creates in /usr/local/var/rancid/logs/ show:<br>
<br>
+ date<br>
+ echo starting: Sun Nov 13 10:34:21 CST 2011<br>
starting: Sun Nov 13 10:34:21 CST 2011<br>
+ echo<br>
+ [ -f /tmp/.group.run.lock ]<br>
+ trap rm -fr $LOCKFILE;exit 1 1 2 3 6 10 15<br>
+ touch /tmp/.group.run.lock<br>
+ [ 0 -eq 0 ]<br>
+ control_rancid -r HOSTNAME group<br>
Trying to get all of the configs.<br>
HOSTNAME clogin error: Error: TIMEOUT reached<br>
HOSTNAME: missed cmd(s): dir /all slavedisk2:,show rsp<br>
chassis-info,dir /all sec-slot2:,show diag,dir /all disk1:,show gsr<br>
chassis,dir /all sec-nvram:,show diag chassis-info,dir /all disk2:,dir<br>
/all sec-bootflash:,show spe version,dir /all slaveslot2:,dir /all<br>
disk0:,show install active,show bootvar,dir /all slaveslot0:,dir /all<br>
sec-slot1:,dir /all harddiska:,dir /all slavenvram:,show flash,dir<br>
/all sec-disk2:,dir /all slavesup-bootflash:,dir /all sec-disk0:,dir<br>
/all harddiskb:,show variables boot,show boot,show inventory raw,dir<br>
/all slavedisk1:,show env all,show module,show controllers,show<br>
diagbus,more system:running-config,dir /all slavedisk0:,show<br>
debug,show idprom backplane,dir /all bootflash:,dir /all<br>
sec-slot0:,dir /all sec-disk1:,write term,show vtp status,dir /all<br>
sup-bootflash:,dir /all slot2:,dir /all harddisk:,dir /all slot0:,dir<br>
/all sup-microcode:,show vlan,dir /all slavebootflash:,show<br>
controllers cbus,dir /all slaveslot1:,dir /all nvram:,show<br>
version,show vlan-switch,show redundancy secondary,show<br>
running-config,show c7200,dir /all slot1:<br>
HOSTNAME: End of run not found<br>
=====================================<br>
<br>
..repeat for 4 rounds.<br>
<br>
Debugging on the server shows that the unprivileged user did<br>
successfully log in but root&#39;s history file doesn&#39;t indicate that any<br>
commands were issued, unlike when &#39;rancid -d&#39; was run. What am I<br>
missing that would make this all work fine with `rancid` and `clogin`<br>
but not `rancid-run`?<br>
_______________________________________________<br>
Rancid-discuss mailing list<br>
<a href="mailto:Rancid-discuss@shrubbery.net">Rancid-discuss@shrubbery.net</a><br>
<a href="http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss" target="_blank">http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss</a><br>
</blockquote></div><br></div>