[rancid] supermicro switch (again)

heasley heas at shrubbery.net
Mon Nov 21 06:35:21 UTC 2016

Thu, Nov 17, 2016 at 02:12:31PM +0100, Marcin Dulak:
> Now, most of the posts suggest that the reason for getting "End of run not
> found" is that rancid does not recognize
> when the session to the switch is terminated. On Supermicro that seems to
> be "supermicro-switch#exit".

That is
	  if (!$clean_run || !$found_end) {
if !(command failure or undefined function or unexpected command or end of
session missing)
!(found end of the config)

> I'm trying to find out the workflow of rancid in order to make the
> adjustments:
> $ grep '#exit\$' usr/share/perl5/vendor_perl/rancid/*
> usr/share/perl5/vendor_perl/rancid/edgemax.pm:    if (/\#exit$/) {
> usr/share/perl5/vendor_perl/rancid/foundry.pm:    if (/\#exit$/) {
> $ grep '#exit\$' usr/libexec/rancid/*
> usr/libexec/rancid/rrancid:    if (/\#exit$/) {
> First question: what is the purpose of usr/libexec/rancid/rrancid compared
> to the perl modules under usr/share/perl5/vendor_perl/rancid?

rancid is function used by some (eventually all) of the rancid modules.
rrancid is the redback module.

> Second question - I'm doing:
> $ cat etc/rancid/rancid.types.conf
> supermicro;script;rrancid
> supermicro;login;smlogin
> supermicro;inloop;edgemax::inloop
> supermicro;command;edgemax::ShowVersion;show version
> 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:
> supermicro;script;dummy
> supermicro;login;smlogin
> supermicro;inloop;dummy::inloop
> I would imagine something like that would be caught by rancid configuration
> parser as incorrect and prevent the run?

how would it know until it tries to import the module?  I did add recently
for 3.6:

        rancid.pm: check for existence of functions for given device type after
        loading the modules for the type.  return failure if any are missing.

> Adding debug prints to the check for completness in
> usr/libexec/rancid/rancid (also suggested in some posts) is not helpful:
> printf(STDERR "$host: missed cmd(s): all commands\n");
> printf(STDERR "$host: $clean_run\n");
> printf(STDERR "$host: $found_end\n");
> $ rancid -d -t supermicro supermicro-switch
> loadtype: device type supermicro
> loadtype: found device type supermicro in ./etc/rancid/rancid.types.conf
> executing smlogin -t 90 -c"show version" supermicro-switch

split it into pieces;

eval `rancid -C -t supermicro supermicro-switch` >output

make sure that works.  then work on the module

rancid -d -t supermicro -f output

> supermicro-switch: missed cmd(s): all commands
> supermicro-switch: 0
> supermicro-switch: 0
> supermicro-switch: End of run not found
> Marcin

More information about the Rancid-discuss mailing list