<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 21, 2016 at 7:35 AM, 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">Thu, Nov 17, 2016 at 02:12:31PM +0100, Marcin Dulak:<br>
<span class="gmail-">> Now, most of the posts suggest that the reason for getting "End of run not<br>
> found" is that rancid does not recognize<br>
> when the session to the switch is terminated. On Supermicro that seems to<br>
> be "supermicro-switch#exit".<br>
<br>
</span>That is<br>
if (!$clean_run || !$found_end) {<br>
if !(command failure or undefined function or unexpected command or end of<br>
session missing)<br>
or<br>
!(found end of the config)<br>
<span class="gmail-"><br>
> I'm trying to find out the workflow of rancid in order to make the<br>
> adjustments:<br>
><br>
> $ grep '#exit\$' usr/share/perl5/vendor_perl/<wbr>rancid/*<br>
> usr/share/perl5/vendor_perl/<wbr>rancid/<a href="http://edgemax.pm" rel="noreferrer" target="_blank">edgemax.pm</a>: if (/\#exit$/) {<br>
> usr/share/perl5/vendor_perl/<wbr>rancid/<a href="http://foundry.pm" rel="noreferrer" target="_blank">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<br>
> to the perl modules under usr/share/perl5/vendor_perl/<wbr>rancid?<br>
<br>
</span>rancid is function used by some (eventually all) of the rancid modules.<br>
rrancid is the redback module.<br>
<span class="gmail-"><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::<wbr>inloop<br>
> supermicro;command;edgemax::<wbr>ShowVersion;show version<br>
><br>
> but I can see that there seem to be no effect due to what I write for some<br>
> of these options, e.g. I can do without errors:<br>
> supermicro;script;dummy<br>
> supermicro;login;smlogin<br>
> supermicro;inloop;dummy::<wbr>inloop<br>
><br>
> I would imagine something like that would be caught by rancid configuration<br>
> parser as incorrect and prevent the run?<br>
<br>
</span>how would it know until it tries to import the module? I did add recently<br>
for 3.6:<br>
<br>
<a href="http://rancid.pm" rel="noreferrer" target="_blank">rancid.pm</a>: check for existence of functions for given device type after<br>
loading the modules for the type. return failure if any are missing.<br>
<span class="gmail-"><br>
> Adding debug prints to the check for completness in<br>
> 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>
<br>
</span>split it into pieces;<br>
<br>
eval `rancid -C -t supermicro supermicro-switch` >output<br></blockquote><div><br></div><div>this works. <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>
make sure that works. then work on the module<br></blockquote><div><br>naively I do:<br>cp usr/share/perl5/vendor_perl/rancid/<a href="http://edgemax.pm">edgemax.pm</a> usr/share/perl5/vendor_perl/rancid/<a href="http://supermicro.pm">supermicro.pm</a><br></div><div>change "package supermicro;" on the top and add a print STDERR ("I'm here"); to ShowVersion,<br></div><div>but "I'm here" does no appear in the output of:<br></div><div><div>$ rancid -d -t supermicro supermicro-switch<br><br></div><div>This goes back to my question: what gets executed when I replace "supermicro::" with "dummy::" in<br></div><div><br></div></div><div>$ cat ./etc/rancid/rancid.types.conf<br></div><div>supermicro;script;rancid<br>supermicro;login;smlogin<br>supermicro;inloop;supermicro::inloop<br>supermicro;command;supermicro::ShowVersion;show version<br><br></div><div>Marcin<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>
rancid -d -t supermicro -f output<br>
<div class="gmail-HOEnZb"><div class="gmail-h5"><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>
> Marcin<br>
</div></div></blockquote></div><br></div></div>