<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body><div style="font-family:Helvetica,Arial;font-size:13px">Hey John,</div><div style="font-family:Helvetica,Arial;font-size:13px"><br></div><div style="font-family:Helvetica,Arial;font-size:13px">So I poked around various rancid files. I discovered that the "/usr/local/rancid/lib/rancid/<a href="http://nxos.pm">nxos.pm</a>" 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 "<a href="http://nxos.pm">nxos.pm</a>" 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?</div><div style="font-family:Helvetica,Arial;font-size:13px"><br></div><div style="font-family:Helvetica,Arial;font-size:13px">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.</div><div style="font-family:Helvetica,Arial;font-size:13px"><br></div><div style="font-family:Helvetica,Arial;font-size:13px">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 :(.</div><div style="font-family:Helvetica,Arial;font-size:13px"><br></div><div style="font-family:Helvetica,Arial;font-size:13px">Thanks for your input. Hope somebody finds this hack useful.</div><div style="font-family:Helvetica,Arial;font-size:13px"><span style="font-size:11pt;font-family:Calibri,sans-serif"><br></span></div><div style="margin:0px">[1]<span style="font-family:Calibri,sans-serif;font-size:11pt"> </span></div><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 81pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IE" style="font-family:Consolas">1018     # The ContentEngine lacks a definitive "end of config" marker.  If we</span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 81pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IE" style="font-family:Consolas">1019     # know that it is NXOS and we have seen at least 5 lines</span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 81pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IE" style="font-family:Consolas">1020     # of write term output, we can be reasonably sure that we got the config.</span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 81pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IE" style="font-family:Consolas">1021 #   if (($type eq "NXOS") && $linecnt > 5) {</span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 81pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IE" style="font-family:Consolas">1022     if ($linecnt > 5) {</span></p> <div class="gmail_signature"> <br></div> <br><p class="airmail_on">On 23 July 2019 at 18:42:21, john heasley (<a href="mailto:heas@shrubbery.net">heas@shrubbery.net</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>Tue, Jul 23, 2019 at 01:29:01AM -0700, Florin Vlad Olariu:
<br>> I am running version 3.9 [2] and the logs looks like in [1]. I tried
<br>> un-commenting the line that states
<br>> "#cisco-nx;command;rancid::RunCommand;term no monitor-force" but it doesn't
<br>> work anyway.
<br>
<br>keep that; it prevents logs/etc from mangling prompts and commands that
<br>rancid wants to match.
<br>
<br>> Reading about your comment on "show version" made me try and un-comment
<br>> that line... (and only that line) and after that it worked!. But why do I
<br>> need to have show version in there at all for this to properly work?
<br>>  
<br>> An alternative solution I had was to put variables "$clean_run" and
<br>> "$found_end" to 1 in the /usr/local/rancid/bin/rancid file, but of course
<br>> this is not ideal as it applies to all types of routers.
<br>>  
<br>> Any idea how can I gather config _without_ needing "show version" also?
<br>
<br>As I mentioned, the model sometimes affects the handling of the config.
<br>I do not remember off the top why this is so in nxos.  i'll try to look
<br>later.  its not that much extra data and it should all be commented.
<br></div></div></span></blockquote></body></html>