<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 16, 2016 at 9:14 PM, heasley <span dir="ltr"><<a href="mailto:heas@shrubbery.net" target="_blank">heas@shrubbery.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Tue, Nov 15, 2016 at 06:09:20PM +0100, Marcin Dulak:<br>
<div><div class="gmail-h5">> Hi,<br>
><br>
> I read through this thread ending with no solution<br>
> <a href="http://www.shrubbery.net/pipermail/rancid-discuss/2013-November/007279.html" rel="noreferrer" target="_blank">http://www.shrubbery.net/<wbr>pipermail/rancid-discuss/2013-<wbr>November/007279.html</a><br>
><br>
> Things I have tried:<br>
><br>
> Version rancid-3.1-4.el6.x86_64<br>
><br>
> 0.<br>
> add to ~rancid/.cloginrc the supermicro-switch settings<br>
><br>
> add autoenable supermicro-switch 1<br>
> add user       supermicro-switch username<br>
> add password   supermicro-switch password password<br>
> add method     supermicro-switch ssh<br>
><br>
><br>
> 1.<br>
> clogin shows errors out-of-the-box, this is expected<br>
><br>
> rancid $ clogin -c"show version" supermicro-switch<br>
> supermicro-switch<br>
> spawn ssh -c 3des -x -l username supermicro-switch<br>
> username@supermicro-switch's password:<br>
><br>
>          Supermicro Switch<br>
><br>
> supermicro-switch#<br>
> supermicro-switch# terminal length 0<br>
> % Invalid Command<br>
> supermicro-switch# terminal width 132<br>
> % Invalid Command<br>
> supermicro-switch#  show version<br>
> Switch ID  Hardware Version             Firmware Version  OS<br>
> Version<br>
> 0          XXX-XXXX Rev. X   (XX-XX)    X.X.X-X           X.X.X<br>
> supermicro-switch#exit<br>
><br>
> 2.<br>
> copy clogin to smlogin<br>
><br>
> root # cp /usr/libexec/rancid/clogin /usr/libexec/rancid/smlogin<br>
><br>
> and replace the offending<br>
> send "terminal length 0\r" and send "terminal width 132\r" with with send<br>
> "\r"<br>
<br>
</div></div>so, how do you turn of the pager?<br></blockquote><div><br><a href="https://www.supermicro.com/manuals/other/SM-CLI-Guide.pdf">https://www.supermicro.com/manuals/other/SM-CLI-Guide.pdf</a> page 72: no cli pagination<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
does supermicro actually make the switch, or is it an OEM for which a script<br>
may already exist.<br>
<span class="gmail-"><br>
> After that this returns without errors:<br>
><br>
> rancid $ smlogin -c"show version" supermicro-switch<br>
><br>
> 3.<br>
> rancid $ rancid -d supermicro-switch<br>
> loadtype(): device_type is empty<br>
> Couldn't load device type spec for<br>
><br>
> So I add to /etc/rancid/rancid.types.base:<br>
><br>
> supermicro;script;rancid -t supermicro<br>
<br>
</span>This implies that there is a lib/<a href="http://supermicro.pm" rel="noreferrer" target="_blank">supermicro.pm</a> library.<br>
<span class="gmail-"><br>
> supermicro;login;smlogin<br>
> supermicro;inloop;supermicro::<wbr>inloop<br>
> supermicro;command;supermicro:<wbr>:ShowVersion;show version<br>
> supermicro;command;supermicro:<wbr>:WriteTerm;show running-config<br>
><br>
> and then:<br>
><br>
> rancid $ rancid -d -t supermicro supermicro-switch<br>
> loadtype: device type supermicro<br>
> loadtype: found device type supermicro in /etc/rancid/rancid.types.base<br>
> executing smlogin -t 90 -c"show version;show running-config"<br>
> supermicro-switch<br>
> supermicro-switch: missed cmd(s): all commands<br>
> supermicro-switch: End of run not found<br>
> supermicro-switch: End of run not found<br>
><br>
> but as we know executing directly on the command line works: smlogin -t 90<br>
> -c"show version;show running-config" supermicro-switch<br>
><br>
> To further debug I create `cp /usr/libexec/rancid/rancid<br>
> /usr/libexec/rancid/smrancid` and point to it with<br>
> supermicro;script;smrancid -t supermicro<br>
> but my guess is wrong: some other script than /usr/libexec/rancid/smrancid<br>
> is executed during `rancid -d -t supermicro supermicro-switch`<br>
><br>
> How to debug this further?<br>
<br>
</span>i'd start with rancid 3.5.1.<br></blockquote><div><br></div><div>I'm at the latest version now.<br><br>$ rancid -V<br>rancid 3.5.1<br><br>$ cat ~/.cloginrc<br>add autoenable supermicro-switch 1<br>add user       supermicro-switch username<br>add password   supermicro-switch password password<br>add method     supermicro-switch ssh<br><br>Created smlogin based on blogin so `smlogin -c"show version"  supermicro-switch` runs fine:<br><br>$ diff usr/libexec/rancid/blogin usr/libexec/rancid/smlogin <br>501c501<br><     send "more off\r"<br>---<br>>     send "no cli pagination\r"<br><br>Now, most of the posts suggest that the reason for getting "End of run not found" is that rancid does not recognize<br>when the session to the switch is terminated. On Supermicro that seems to be "supermicro-switch#exit".<br><br>I'm trying to find out the workflow of rancid in order to make the adjustments:<br><br>$ grep '#exit\$' usr/share/perl5/vendor_perl/rancid/*<br>usr/share/perl5/vendor_perl/rancid/<a href="http://edgemax.pm">edgemax.pm</a>:    if (/\#exit$/) {<br>usr/share/perl5/vendor_perl/rancid/<a href="http://foundry.pm">foundry.pm</a>:    if (/\#exit$/) {<br><br>$ grep '#exit\$' usr/libexec/rancid/*<br>usr/libexec/rancid/rrancid:    if (/\#exit$/) {<br><br>First question: what is the purpose of usr/libexec/rancid/rrancid compared to the perl modules under usr/share/perl5/vendor_perl/rancid?<br><br>Second question - I'm doing:<br><br>$ cat etc/rancid/rancid.types.conf <br>supermicro;script;rrancid<br>supermicro;login;smlogin<br>supermicro;inloop;edgemax::inloop<br>supermicro;command;edgemax::ShowVersion;show version<br><br>but I can see that there seem to be no effect due to what I write for some of these options, e.g. I can do without errors:<br>supermicro;script;dummy<br>supermicro;login;smlogin<br>supermicro;inloop;dummy::inloop<br><br>I would imagine something like that would be caught by rancid configuration parser as incorrect and prevent the run?<br><br>Adding debug prints to the check for completness in usr/libexec/rancid/rancid (also suggested in some posts) is not helpful:<br>printf(STDERR "$host: missed cmd(s): all commands\n");<br>printf(STDERR "$host: $clean_run\n");<br>printf(STDERR "$host: $found_end\n");<br><br>$ rancid -d -t supermicro supermicro-switch<br>loadtype: device type supermicro<br>loadtype: found device type supermicro in ./etc/rancid/rancid.types.conf<br>executing smlogin -t 90 -c"show version" supermicro-switch<br>supermicro-switch: missed cmd(s): all commands<br>supermicro-switch: 0<br>supermicro-switch: 0<br>supermicro-switch: End of run not found<br><br></div><div>Marcin<br></div></div><br></div></div>