[rancid] RANCID no longer working with MikroTik RouterOS 6.49 and 7.1rc3 and 7.1rc4

Michael Ducharme mducharme at gmail.com
Sun Oct 17 00:35:16 UTC 2021


Hello,

Unfortunately, that does not fix it, and neither does "network" or "dumb".
Something that I might suggest is that you install the free CHR (cloud
hosted router) as a VM rather easily, as long as you have a hypervisor, and
test against that.

On Fri, Oct 15, 2021 at 1:56 PM heasley <heas at shrubbery.net> wrote:

> Fri, Oct 15, 2021 at 01:39:18PM -0700, Michael Ducharme:
> > Hello,
> >
> > 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.
> >
> > 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:
> > https://forum.mikrotik.com/viewtopic.php?t=179233#p885616
>
> ah, thats a separate problem.  thats fun.  without looking-up that esc
> code, looks like some fancy cmdline hanlding.  Maybe this will avoid
> that stupidity?
>
> diff --git a/lib/routeros.pm.in b/lib/routeros.pm.in
> index 3b1b7dae..4ab9730e 100644
> --- a/lib/routeros.pm.in
> +++ b/lib/routeros.pm.in
> @@ -23,6 +23,8 @@ use rancid @VERSION@;
>
>  # load-time initialization
>  sub import {
> +    $ENV{'TERM'} = "vt100";
> +
>      $timeo = 90;                       # mtlogin timeout in seconds
>
>      0;
>
> or "network" or "dumb", if it has either in its termcap.
>
> > 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:
>
> it could match other output unintentionally - maybe.
>
> > --- /usr/libexec/rancid/mtrancid-orig       2021-10-14
> > 03:44:22.102333666 +0200+++ /usr/libexec/rancid/mtrancid
> > 2021-10-13 07:16:22.567538444 +0200@@ -348,7 +348,7 @@
> >         $clean_run=0;
> >         last;
> >      }
> > -    while (/\s*($cmds_regexp)\s*$/) {
> > +    while (/\s*($cmds_regexp)\s*/) {
> >         $cmd = $1;
> >         if (!defined($prompt)) {
> >             $prompt = "\] > ";  # crude but effective
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20211016/eb88ed13/attachment.htm>


More information about the Rancid-discuss mailing list