<div dir="ltr"><div>Hello,</div><div><br></div><div>I had a look at your patch and I'm not sure that would fix the issue. Also show-sensitive only works with v7 and above and throws an error on RouterOS v6.</div><div><br></div><div>Someone on the MikroTik forums found that there is no longer a newline being generated after the output so the regexp doesn't match and so RANCID no longer identifies the end of the command. You can see more detail here: <a href="https://forum.mikrotik.com/viewtopic.php?t=179233#p885616">https://forum.mikrotik.com/viewtopic.php?t=179233#p885616</a></div><div><br></div><div>They came up with this patch to fix it and I confirmed that it works with RouterOS v6.49 and v7. However I haven't tested with older RouterOS versions, and I don't know if it might break something else:</div><div><br></div><div>
<pre><code class="gmail-prettyprint gmail-prettyprinted"><span class="gmail-pun">---</span><span class="gmail-pln"> </span><span class="gmail-pun">/</span><span class="gmail-pln">usr</span><span class="gmail-pun">/</span><span class="gmail-pln">libexec</span><span class="gmail-pun">/</span><span class="gmail-pln">rancid</span><span class="gmail-pun">/</span><span class="gmail-pln">mtrancid</span><span class="gmail-pun">-</span><span class="gmail-pln">orig </span><span class="gmail-lit">2021</span><span class="gmail-pun">-</span><span class="gmail-lit">10</span><span class="gmail-pun">-</span><span class="gmail-lit">14</span><span class="gmail-pln"> </span><span class="gmail-lit">03</span><span class="gmail-pun">:</span><span class="gmail-lit">44</span><span class="gmail-pun">:</span><span class="gmail-lit">22.102333666</span><span class="gmail-pln"> </span><span class="gmail-pun">+</span><span class="gmail-lit">0200</span><span class="gmail-pln">
</span><span class="gmail-pun">+++</span><span class="gmail-pln"> </span><span class="gmail-pun">/</span><span class="gmail-pln">usr</span><span class="gmail-pun">/</span><span class="gmail-pln">libexec</span><span class="gmail-pun">/</span><span class="gmail-pln">rancid</span><span class="gmail-pun">/</span><span class="gmail-pln">mtrancid </span><span class="gmail-lit">2021</span><span class="gmail-pun">-</span><span class="gmail-lit">10</span><span class="gmail-pun">-</span><span class="gmail-lit">13</span><span class="gmail-pln"> </span><span class="gmail-lit">07</span><span class="gmail-pun">:</span><span class="gmail-lit">16</span><span class="gmail-pun">:</span><span class="gmail-lit">22.567538444</span><span class="gmail-pln"> </span><span class="gmail-pun">+</span><span class="gmail-lit">0200</span><span class="gmail-pln">
</span><span class="gmail-pun">@@</span><span class="gmail-pln"> </span><span class="gmail-pun">-</span><span class="gmail-lit">348</span><span class="gmail-pun">,</span><span class="gmail-lit">7</span><span class="gmail-pln"> </span><span class="gmail-pun">+</span><span class="gmail-lit">348</span><span class="gmail-pun">,</span><span class="gmail-lit">7</span><span class="gmail-pln"> </span><span class="gmail-pun">@@</span><span class="gmail-pln">
$clean_run</span><span class="gmail-pun">=</span><span class="gmail-lit">0</span><span class="gmail-pun">;</span><span class="gmail-pln">
</span><span class="gmail-kwd">last</span><span class="gmail-pun">;</span><span class="gmail-pln">
</span><span class="gmail-pun">}</span><span class="gmail-pln">
</span><span class="gmail-pun">-</span><span class="gmail-pln"> </span><span class="gmail-kwd">while</span><span class="gmail-pln"> </span><span class="gmail-pun">(</span><span class="gmail-str">/\s*($cmds_regexp)\s*$/</span><span class="gmail-pun">)</span><span class="gmail-pln"> </span><span class="gmail-pun">{</span><span class="gmail-pln">
</span><span class="gmail-pun">+</span><span class="gmail-pln"> </span><span class="gmail-kwd">while</span><span class="gmail-pln"> </span><span class="gmail-pun">(</span><span class="gmail-str">/\s*($cmds_regexp)\s*/</span><span class="gmail-pun">)</span><span class="gmail-pln"> </span><span class="gmail-pun">{</span><span class="gmail-pln">
$cmd </span><span class="gmail-pun">=</span><span class="gmail-pln"> $1</span><span class="gmail-pun">;</span><span class="gmail-pln">
</span><span class="gmail-kwd">if</span><span class="gmail-pln"> </span><span class="gmail-pun">(!</span><span class="gmail-kwd">defined</span><span class="gmail-pun">(</span><span class="gmail-pln">$prompt</span><span class="gmail-pun">))</span><span class="gmail-pln"> </span><span class="gmail-pun">{</span><span class="gmail-pln">
$prompt </span><span class="gmail-pun">=</span><span class="gmail-pln"> </span><span class="gmail-str">"\] > "</span><span class="gmail-pun">;</span><span class="gmail-pln"> </span><span class="gmail-com"># crude but effective</span></code></pre>
</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 15, 2021 at 1:20 PM heasley <<a href="mailto:heas@shrubbery.net">heas@shrubbery.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Mon, Oct 11, 2021 at 06:28:39PM -0700, Michael Ducharme:<br>
> Hello,<br>
> <br>
> I just wanted to let you know - on the MikroTik forum I am seeing reports<br>
> that RANCID is no longer working to back up RouterOS versions 6.49 and<br>
> 7.1rc3 and 7.1rc4. The commands still run and there were no documented<br>
> changes to the console or SSH on the MikroTik side recently, so I'm not<br>
> sure why this is happening suddenly. I was trying to go through the code to<br>
> see what the problem might be, but could not find anything.<br>
> <br>
> Please see this post for details on the error:<br>
> <a href="https://forum.mikrotik.com/viewtopic.php?p=885246#p885246" rel="noreferrer" target="_blank">https://forum.mikrotik.com/viewtopic.php?p=885246#p885246</a><br>
<br>
Care to the attached patch? <br>
<br>
> I also tried loading up the output of the working 6.48.4 vs non-working<br>
> 6.49 into a hex editor to see if there were any unexpected characters being<br>
> added that might be confusing RANCID but did not find anything of note. It<br>
> looks pretty much the same to me.<br>
<br>
I have access to only one Mikrotik and its running an older O/S. I've<br>
tested the patch against it.<br>
</blockquote></div>