[rancid] Prompt detection eats exit, clean run not found
heasley
heas at shrubbery.net
Fri Jan 5 18:08:43 UTC 2018
Fri, Jan 05, 2018 at 09:40:28AM -0600, Brandon Ewing:
> It appears that several modules for rancid rely on non-prompt exits from
> specific commands (IE, "end" at the end of WriteTerm) to ensure that the
> "exit" string is available for inloop to detect to mark a clean run.
>
> Devices that do not have an end marker, or custom types that do not have
> WriteTerm last, have to fall back on prompt detection, which in most
> modules, also swallows the "exit" string.
>
> It appears this is fixed in aeos.pm with a GOTO CMD statement, but that
> doesn't appear standard in other modules.
right, if $_ has a prompt, evaluate it, dont read another line.
if (defined($prompt)) {
if (/$prompt/) {
goto CMD;
}
}
> You can reproduce this error by defining a custom type:
>
> test;script;rancid -t test
> test;login;clogin
> test;module;ios
> test;inloop;ios::inloop
> test;command;ios::WriteTerm;show running-config
> test;command;ios::ShowVersion;show version
>
> rancid -dt test ios
> loadtype: device type test
> loadtype: found device type test in /home/bewing/etc/rancid.types.conf
> executing clogin -t 90 -c"show running-config;show version" ios
> PROMPT MATCH: ios#
> HIT COMMAND:ios#show running-config
> In WriteTerm: ios#show running-config
> HIT COMMAND:ios#show version
> In ShowVersion: ios#show version
> TYPE = WS-C3850-48U
thats ios, it should have and eng marker; if it does not, then its broken.
and, ios devices and others do this from time to time; they leak memory
until they have so little free that they can not produce a full human-
display config, then they just truncate it. others produce no output, but
indicate success or lack an error. hence, the checks.
> ios: End of run not found
> ios: clean_run is false
> !BOOTLDR: Version 3.58, RELEASE SOFTWARE (P)
>
>
> --
> Brandon Ewing (nicotine at warningg.com)
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo/rancid-discuss
More information about the Rancid-discuss
mailing list