[rancid] Rancid and the Cisco 5000 Nexus Platform

Florin Vlad Olariu vv.corto at gmail.com
Thu Jul 25 10:57:11 UTC 2019


Hey John,

So I poked around various rancid files. I discovered that the
"/usr/local/rancid/lib/rancid/nxos.pm" file/module sets a "type" variable
in the "ShowVersion" function which is then checked at the end (see [1]) to
test if we're on a NXOS platform. This module acknowledges the fact that
NXOS does not have an "end" marker, but I'm not sure why a "nxos.pm" module
would need to test if this is a nexus platform? Or at least, why bundle it
in the "ShowVersion" function without the option to include that output in
the config collected or not?

I'm sure there's some historical reason for it, just don't have the
context. For my particular case, I commented out line 1021 and left only
the $linecnt check in. This way I can get rid of "show version" output in
my config file and it affects only cisco-nx.

This is clearly a hack that will make upgrading more difficult, but my
knowledge of perl is basically 0 so can't really propose a more sane thing
here :(.

Thanks for your input. Hope somebody finds this hack useful.

[1]

1018     # The ContentEngine lacks a definitive "end of config" marker.  If
we

1019     # know that it is NXOS and we have seen at least 5 lines

1020     # of write term output, we can be reasonably sure that we got the
config.

1021 #   if (($type eq "NXOS") && $linecnt > 5) {

1022     if ($linecnt > 5) {


On 23 July 2019 at 18:42:21, john heasley (heas at shrubbery.net) wrote:

Tue, Jul 23, 2019 at 01:29:01AM -0700, Florin Vlad Olariu:
> I am running version 3.9 [2] and the logs looks like in [1]. I tried
> un-commenting the line that states
> "#cisco-nx;command;rancid::RunCommand;term no monitor-force" but it
doesn't
> work anyway.

keep that; it prevents logs/etc from mangling prompts and commands that
rancid wants to match.

> Reading about your comment on "show version" made me try and un-comment
> that line... (and only that line) and after that it worked!. But why do I
> need to have show version in there at all for this to properly work?
>
> An alternative solution I had was to put variables "$clean_run" and
> "$found_end" to 1 in the /usr/local/rancid/bin/rancid file, but of course
> this is not ideal as it applies to all types of routers.
>
> Any idea how can I gather config _without_ needing "show version" also?

As I mentioned, the model sometimes affects the handling of the config.
I do not remember off the top why this is so in nxos. i'll try to look
later. its not that much extra data and it should all be commented.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20190725/8d1e5215/attachment.html>


More information about the Rancid-discuss mailing list